set up instance of storage class

main
bat 3 years ago
parent 8696ad8228
commit b66e298ac8

@ -1,3 +1,4 @@
import { Storage } from "/storage/storage.js"
import { Layout } from "/components/layout.js"
import { Page } from "/components/page.js"
import { PageActions } from "/components/page-actions.js"
@ -41,6 +42,13 @@ customElements.define(
)
class Setup {
constructor() {
this.layout = document.createElement(
'm-layout'
)
this.layout.storage = new Storage()
}
async runWithSw() {
navigator.serviceWorker.addEventListener(
'controllerchange',
@ -55,12 +63,10 @@ class Setup {
}
async runWithoutSw() {
const layout = document.createElement(
'm-layout'
)
layout.csp = undefined
layout.header.menu.handleLinks = true
document.body.appendChild(layout)
this.layout.storage = new Storage()
this.layout.csp = undefined
this.layout.header.menu.handleLinks = true
document.body.appendChild(this.layout)
}
async register() {
@ -83,7 +89,7 @@ class Setup {
load() {
if (this.registration.active) {
document.body.appendChild(
document.createElement('m-layout')
this.layout
)
}
}

Loading…
Cancel
Save