This commit is contained in:
Vanessa 2023-01-01 14:09:23 +08:00
parent abdb091c17
commit 2f58714b79
2 changed files with 5 additions and 5 deletions

View file

@ -424,7 +424,7 @@ export class Asset extends Model {
</div> </div>
</div> <!-- outerContainer --> </div> <!-- outerContainer -->
<div id="printContainer"></div>`; <div id="printContainer"></div>`;
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 pdfTheme = window.siyuan.config.appearance.mode === 0 ? localPDF.light : localPDF.dark;
const darkElement = this.element.querySelector("#pdfDark"); const darkElement = this.element.querySelector("#pdfDark");
const lightElement = this.element.querySelector("#pdfLight"); const lightElement = this.element.querySelector("#pdfLight");

View file

@ -141,14 +141,14 @@ export const hotKey2Electron = (key: string) => {
export const setLocalStorage = (data?: IWebSocketData) => { export const setLocalStorage = (data?: IWebSocketData) => {
if (data) { if (data) {
setDefaultStorage(data) setDefaultStorage(data);
} else { } else {
fetchPost("/api/storage/getLocalStorage", undefined, (response) => { fetchPost("/api/storage/getLocalStorage", undefined, (response) => {
setDefaultStorage(response) setDefaultStorage(response);
}); });
} }
}; };
const setDefaultStorage = (response: IWebSocketData) => { const setDefaultStorage = (response: IWebSocketData) => {
window.siyuan.storage = response.data; window.siyuan.storage = response.data;
// 历史数据迁移 // 历史数据迁移
@ -218,7 +218,7 @@ const setDefaultStorage = (response: IWebSocketData) => {
window.siyuan.storage[key] = defaultStorage[key]; window.siyuan.storage[key] = defaultStorage[key];
} }
}); });
} };
export const exportLocalStorage = (cb?: () => void) => { export const exportLocalStorage = (cb?: () => void) => {
fetchPost("/api/storage/setLocalStorage", {val: window.siyuan.storage}, () => { fetchPost("/api/storage/setLocalStorage", {val: window.siyuan.storage}, () => {