Revert "store cache eagerly"

This reverts commit 21af30f71b.
This commit is contained in:
Henry Jameson 2025-02-10 23:02:34 +02:00
parent 7aee12bcd4
commit f8fa540af7

View file

@ -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