parent
7aee12bcd4
commit
f8fa540af7
1 changed files with 5 additions and 3 deletions
|
@ -137,7 +137,6 @@ export const applyTheme = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let cache
|
|
||||||
const { lazyProcessFunc } = generateTheme(
|
const { lazyProcessFunc } = generateTheme(
|
||||||
input,
|
input,
|
||||||
{
|
{
|
||||||
|
@ -150,13 +149,16 @@ export const applyTheme = (
|
||||||
},
|
},
|
||||||
onEagerFinished () {
|
onEagerFinished () {
|
||||||
adoptStyleSheets([eagerStyles])
|
adoptStyleSheets([eagerStyles])
|
||||||
cache = { engineChecksum: getEngineChecksum(), data: [eagerStyles.rules, lazyStyles.rules] }
|
|
||||||
localforage.setItem('pleromafe-theme-cache', cache)
|
|
||||||
onEagerFinish()
|
onEagerFinish()
|
||||||
},
|
},
|
||||||
onLazyFinished () {
|
onLazyFinished () {
|
||||||
adoptStyleSheets([eagerStyles, lazyStyles])
|
adoptStyleSheets([eagerStyles, lazyStyles])
|
||||||
|
const cache = { engineChecksum: getEngineChecksum(), data: [eagerStyles.rules, lazyStyles.rules] }
|
||||||
onFinish(cache)
|
onFinish(cache)
|
||||||
|
const compress = (js) => {
|
||||||
|
return pako.deflate(JSON.stringify(js))
|
||||||
|
}
|
||||||
|
localforage.setItem('pleromafe-theme-cache', compress(cache))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
debug
|
debug
|
||||||
|
|
Loading…
Add table
Reference in a new issue