Vanessa 2023-12-17 23:54:16 +08:00
parent 40b9c62693
commit e24522b75d
8 changed files with 62 additions and 62 deletions

View file

@ -1,4 +1,4 @@
import {exportLayout, JSONToLayout, resetLayout, resizeTopBar} from "../layout/util";
import {exportLayout, JSONToLayout, resetLayout, resizeTopBar, saveLayout} from "../layout/util";
import {resizeTabs} from "../layout/tabUtil";
import {setStorageVal} from "../protyle/util/compatibility";
/// #if !BROWSER
@ -172,19 +172,6 @@ const winOnMaxRestore = async () => {
/// #endif
};
const saveUI = () => {
exportLayout({
reload: false,
onlyData: false,
errorExit: false
});
};
export const unbindSaveUI = () => {
window.removeEventListener("beforeunload", saveUI);
window.removeEventListener("pagehide", saveUI);
};
export const initWindow = async (app: App) => {
/// #if !BROWSER
const winOnClose = (close = false) => {
@ -514,7 +501,5 @@ ${response.data.replace("%pages", "<span class=totalPages></span>").replace("%pa
if (!isWindow()) {
document.querySelector(".toolbar").classList.add("toolbar--browser");
}
window.addEventListener("beforeunload", saveUI, false);
window.addEventListener("pagehide", saveUI, false);
/// #endif
};