This commit is contained in:
parent
e3ec694f9a
commit
ca747f58a4
1 changed files with 7 additions and 1 deletions
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue