Use Cache API instead of LocalStorage (#128)

* Use Cache API instead of LocalStorage

* Remove old cached data
This commit is contained in:
Misode
2020-12-30 18:58:54 +01:00
committed by GitHub
parent 847bb43fdd
commit e69559f975
6 changed files with 132 additions and 103 deletions

View File

@@ -67,8 +67,9 @@ export const TreePanel = (view: View, model: DataModel) => {
})}">${r}</div>`).join('')
}
const presetControl = view.register(el => {
App.version.watchRun(v => {
const enabled = (m?.path && checkVersion(v, '1.16'))
App.schemasLoaded.watch(v => {
if (!v) return
const enabled = (m?.path && checkVersion(App.version.get(), '1.16'))
el.classList.toggle('disabled', !enabled || (App.collections.get()?.get(registry) ?? []).length === 0)
if (enabled) {
view.mount(presetList, getPresets(), false)