Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/16485

Vanessa806ca9f21371
diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts
index 5511c75ca3..d6ec0e2683 100644
--- a/app/src/plugin/index.ts
+++ b/app/src/plugin/index.ts
@@ -4,7 +4,7 @@ import {fetchPost} from "../util/fetch";
import {isMobile, isWindow} from "../util/functions";
/// #if !MOBILE
import {Custom} from "../layout/dock/Custom";
-import {getAllModels} from "../layout/getAll";
+import {getAllEditor, getAllModels} from "../layout/getAll";
import {Tab} from "../layout/Tab";
import {resizeTopBar, setPanelFocus} from "../layout/util";
import {getDockByType} from "../layout/tabUtil";
@@ -121,6 +121,9 @@ export class Plugin {
uninstall(this.app, this.name, false);
loadPlugins(this.app, [this.name], false).then(() => {
afterLoadPlugin(this);
+ getAllEditor().forEach(editor => {
+ editor.protyle.toolbar.update(editor.protyle);
+ });
});
}
diff --git a/app/src/plugin/loader.ts b/app/src/plugin/loader.ts
index fcf296ec2d..911a53201a 100644
--- a/app/src/plugin/loader.ts
+++ b/app/src/plugin/loader.ts
@@ -238,6 +238,9 @@ export const reloadPlugin = async (app: App, data: {
app.plugins.forEach(item => {
if (upsertCodePlugins.includes(item.name)) {
afterLoadPlugin(item);
+ getAllEditor().forEach(editor => {
+ editor.protyle.toolbar.update(editor.protyle);
+ });
}
});
});
diff --git a/app/src/plugin/uninstall.ts b/app/src/plugin/uninstall.ts
index a3a17fde78..5e4b6181e7 100644
--- a/app/src/plugin/uninstall.ts
+++ b/app/src/plugin/uninstall.ts
@@ -51,6 +51,8 @@ export const uninstall = (app: App, name: string, isUninstall: boolean) => {
// rm dock
const docksKeys = Object.keys(plugin.docks);
docksKeys.forEach(key => {
+ window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][key].show =
+ !!document.querySelector(`.dock__item[data-type="${key}"]`)?.classList.contains("dock__item--active");
if (Object.keys(window.siyuan.layout.leftDock.data).includes(key)) {
window.siyuan.layout.leftDock.remove(key);
} else if (Object.keys(window.siyuan.layout.rightDock.data).includes(key)) {