mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
969a8d24fc
commit
f4e2c3423a
2 changed files with 20 additions and 6 deletions
|
|
@ -101,6 +101,7 @@ export abstract class Constants {
|
||||||
public static readonly LOCAL_PLUGINTOPUNPIN = "local-plugintopunpin";
|
public static readonly LOCAL_PLUGINTOPUNPIN = "local-plugintopunpin";
|
||||||
public static readonly LOCAL_FLASHCARD = "local-flashcard";
|
public static readonly LOCAL_FLASHCARD = "local-flashcard";
|
||||||
public static readonly LOCAL_FILEPOSITION = "local-fileposition";
|
public static readonly LOCAL_FILEPOSITION = "local-fileposition";
|
||||||
|
public static readonly LOCAL_SESSION_FIRSTLOAD = "local-session-firstload";
|
||||||
|
|
||||||
// timeout
|
// timeout
|
||||||
public static readonly TIMEOUT_DBLCLICK = 190;
|
public static readonly TIMEOUT_DBLCLICK = 190;
|
||||||
|
|
|
||||||
|
|
@ -375,12 +375,25 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
|
||||||
JSONToCenter(app, window.siyuan.config.uiLayout.layout, undefined);
|
JSONToCenter(app, window.siyuan.config.uiLayout.layout, undefined);
|
||||||
JSONToDock(window.siyuan.config.uiLayout, app);
|
JSONToDock(window.siyuan.config.uiLayout, app);
|
||||||
// 启动时不打开页签,需要移除没有钉住的页签
|
// 启动时不打开页签,需要移除没有钉住的页签
|
||||||
if (window.siyuan.config.fileTree.closeTabsOnStart && isStart) {
|
if (window.siyuan.config.fileTree.closeTabsOnStart) {
|
||||||
getAllTabs().forEach(item => {
|
/// #if BROWSER
|
||||||
if (item.headElement && !item.headElement.classList.contains("item--pin")) {
|
if (!sessionStorage.getItem(Constants.LOCAL_SESSION_FIRSTLOAD)) {
|
||||||
item.parent.removeTab(item.id, false, false);
|
getAllTabs().forEach(item => {
|
||||||
}
|
if (item.headElement && !item.headElement.classList.contains("item--pin")) {
|
||||||
});
|
item.parent.removeTab(item.id, false, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
sessionStorage.setItem(Constants.LOCAL_SESSION_FIRSTLOAD, "true");
|
||||||
|
}
|
||||||
|
/// #else
|
||||||
|
if (isStart) {
|
||||||
|
getAllTabs().forEach(item => {
|
||||||
|
if (item.headElement && !item.headElement.classList.contains("item--pin")) {
|
||||||
|
item.parent.removeTab(item.id, false, false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/// #endif
|
||||||
}
|
}
|
||||||
app.plugins.forEach(item => {
|
app.plugins.forEach(item => {
|
||||||
afterLoadPlugin(item);
|
afterLoadPlugin(item);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue