From 2f58714b7996fe4f5acd19d93dde5ac842af3e96 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 1 Jan 2023 14:09:23 +0800 Subject: [PATCH] :rotating_light: --- app/src/asset/index.ts | 2 +- app/src/protyle/util/compatibility.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/asset/index.ts b/app/src/asset/index.ts index 24cafd54d..6ba5113d6 100644 --- a/app/src/asset/index.ts +++ b/app/src/asset/index.ts @@ -424,7 +424,7 @@ export class Asset extends Model {
`; - const localPDF = window.siyuan.storage[Constants.LOCAL_PDFTHEME] + const localPDF = window.siyuan.storage[Constants.LOCAL_PDFTHEME]; const pdfTheme = window.siyuan.config.appearance.mode === 0 ? localPDF.light : localPDF.dark; const darkElement = this.element.querySelector("#pdfDark"); const lightElement = this.element.querySelector("#pdfLight"); diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.ts index ebd61de46..41b63d20b 100644 --- a/app/src/protyle/util/compatibility.ts +++ b/app/src/protyle/util/compatibility.ts @@ -141,14 +141,14 @@ export const hotKey2Electron = (key: string) => { export const setLocalStorage = (data?: IWebSocketData) => { if (data) { - setDefaultStorage(data) + setDefaultStorage(data); } else { fetchPost("/api/storage/getLocalStorage", undefined, (response) => { - setDefaultStorage(response) + setDefaultStorage(response); }); } - }; + const setDefaultStorage = (response: IWebSocketData) => { window.siyuan.storage = response.data; // 历史数据迁移 @@ -218,7 +218,7 @@ const setDefaultStorage = (response: IWebSocketData) => { window.siyuan.storage[key] = defaultStorage[key]; } }); -} +}; export const exportLocalStorage = (cb?: () => void) => { fetchPost("/api/storage/setLocalStorage", {val: window.siyuan.storage}, () => {