Vanessa 2026-04-20 11:34:42 +08:00
parent 0e1071f4f4
commit 9edbaf8cd7

View file

@ -76,19 +76,19 @@ export const uninstall = (app: App, name: string, isReload: boolean) => {
}
}
if (Object.keys(window.siyuan.layout.leftDock.data).includes(key)) {
if (window.siyuan.layout.leftDock && Object.keys(window.siyuan.layout.leftDock.data).includes(key)) {
window.siyuan.layout.leftDock.remove(key);
if (dockIconElement) {
window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][key].position =
"Left" + (dockIconElement.getAttribute("data-index") === "0" ? "Top" : "Bottom");
}
} else if (Object.keys(window.siyuan.layout.rightDock.data).includes(key)) {
} else if (window.siyuan.layout.rightDock && Object.keys(window.siyuan.layout.rightDock.data).includes(key)) {
window.siyuan.layout.rightDock.remove(key);
if (dockIconElement) {
window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][key].position =
"Right" + (dockIconElement.getAttribute("data-index") === "0" ? "Top" : "Bottom");
}
} else if (Object.keys(window.siyuan.layout.bottomDock.data).includes(key)) {
} else if (window.siyuan.layout.bottomDock && Object.keys(window.siyuan.layout.bottomDock.data).includes(key)) {
window.siyuan.layout.bottomDock.remove(key);
if (dockIconElement) {
window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][key].position =