Skip to content

Commit

Permalink
🐛 fix #10237
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Jan 24, 2024
1 parent bb49855 commit 6930d48
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/src/config/bazaar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {showMessage} from "../dialog/message";
import {fetchPost} from "../util/fetch";
import {confirmDialog} from "../dialog/confirmDialog";
import {highlightRender} from "../protyle/render/highlightRender";
import {exportLayout} from "../layout/util";
import {exportLayout, saveLayout} from "../layout/util";
import {Constants} from "../constants";
/// #if !BROWSER
import {shell} from "electron";
Expand Down Expand Up @@ -813,6 +813,7 @@ export const bazaar = {
afterLoadPlugin(item);
});
});
saveLayout();
}
});
}
Expand Down
1 change: 1 addition & 0 deletions app/src/layout/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ export const JSONToLayout = (app: App, isStart: boolean) => {
app.plugins.forEach(item => {
afterLoadPlugin(item);
});
saveLayout();
resizeTopBar();
};

Expand Down
2 changes: 2 additions & 0 deletions app/src/menus/dock.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {MenuItem} from "./Menu";
import {saveLayout} from "../layout/util";

const moveMenuItem = (label: string, target: Element) => {
return new MenuItem({
Expand All @@ -12,6 +13,7 @@ const moveMenuItem = (label: string, target: Element) => {
} else if (label.indexOf("moveToBottom") > -1) {
window.siyuan.layout.bottomDock.add(label.endsWith("Left") ? 0 : 1, target);
}
saveLayout();
}
});
};
Expand Down
5 changes: 4 additions & 1 deletion app/src/plugin/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const loadPlugin = async (app: App, item: IPluginData) => {
styleElement.textContent = item.css;
document.head.append(styleElement);
afterLoadPlugin(plugin);
saveLayout();
return plugin;
};

Expand Down Expand Up @@ -229,7 +230,6 @@ export const afterLoadPlugin = (plugin: Plugin) => {
}], dock.config.position === "RightBottom" ? 1 : 0, dock.config.index);
}
});
saveLayout();
/// #endif
};

Expand All @@ -242,4 +242,7 @@ export const reloadPlugin = (app: App) => {
afterLoadPlugin(item);
});
});
/// #if !MOBILE
saveLayout();
/// #endif
};

0 comments on commit 6930d48

Please sign in to comment.