diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index 4976a014c..be8234359 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -217,7 +217,13 @@ export const getLocalStorage = (cb: () => void) => { Constants.LOCAL_ZOOM, Constants.LOCAL_LAYOUTS, Constants.LOCAL_AI, Constants.LOCAL_PLUGINTOPUNPIN].forEach((key) => { if (typeof response.data[key] === "string") { try { - window.siyuan.storage[key] = Object.assign(defaultStorage[key], JSON.parse(response.data[key])); + const parseData = JSON.parse(response.data[key]); + if (typeof parseData === "number") { + // https://github.com/siyuan-note/siyuan/issues/8852 Object.assign 会导致 number to Number + window.siyuan.storage[key] = parseData; + } else { + window.siyuan.storage[key] = Object.assign(defaultStorage[key], parseData); + } } catch (e) { window.siyuan.storage[key] = defaultStorage[key]; }