Vanessa 2025-12-03 19:09:15 +08:00
parent 7154879ddc
commit 806ca9f213
3 changed files with 9 additions and 1 deletions

View file

@ -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);
});
});
}

View file

@ -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);
});
}
});
});

View file

@ -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)) {