better theme cache logging

This commit is contained in:
Henry Jameson 2025-01-28 16:43:02 +02:00
parent 131c763706
commit d7f76f2f91

View file

@ -95,9 +95,10 @@ export const tryLoadCache = async () => {
if (!data) return null if (!data) return null
let cache let cache
try { try {
const decoded = new TextDecoder().decode(pako.inflate(data)) const inflated = pako.inflate(data)
const decoded = new TextDecoder().decode(inflated)
cache = JSON.parse(decoded) cache = JSON.parse(decoded)
console.info(`Loaded theme from cache, size=${cache}`) console.info(`Loaded theme from cache, compressed=${Math.ceil(data.length / 1024)}kiB size=${Math.ceil(inflated.length / 1024)}kiB`)
} catch (e) { } catch (e) {
console.error('Failed to decode theme cache:', e) console.error('Failed to decode theme cache:', e)
return false return false