|
@@ -8,6 +8,7 @@ import {API} from "./API";
|
|
|
import {getFrontend, isMobile, isWindow} from "../util/functions";
|
|
|
import {Constants} from "../constants";
|
|
|
import {uninstall} from "./uninstall";
|
|
|
+import {setStorageVal} from "../protyle/util/compatibility";
|
|
|
|
|
|
const requireFunc = (key: string) => {
|
|
|
const modules = {
|
|
@@ -102,6 +103,11 @@ const updateDock = (dockItem: Config.IUILayoutDockTab[], index: number, plugin:
|
|
|
plugin.docks[tabItem.type].config.index = tabIndex;
|
|
|
plugin.docks[tabItem.type].config.show = tabItem.show;
|
|
|
plugin.docks[tabItem.type].config.size = tabItem.size;
|
|
|
+ if (!window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name]) {
|
|
|
+ window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name] = {}
|
|
|
+ }
|
|
|
+ window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][tabItem.type] = plugin.docks[tabItem.type].config;
|
|
|
+ setStorageVal(Constants.LOCAL_PLUGIN_DOCKS, window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS]);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
@@ -153,6 +159,9 @@ export const afterLoadPlugin = (plugin: Plugin) => {
|
|
|
updateDock(dockItem, index, plugin, "Bottom");
|
|
|
});
|
|
|
Object.keys(plugin.docks).forEach(key => {
|
|
|
+ if (window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][key]) {
|
|
|
+ plugin.docks[key].config = window.siyuan.storage[Constants.LOCAL_PLUGIN_DOCKS][plugin.name][key];
|
|
|
+ }
|
|
|
const dock = plugin.docks[key];
|
|
|
const hotkey = window.siyuan.config.keymap.plugin[plugin.name] ? window.siyuan.config.keymap.plugin[plugin.name][key]?.custom : undefined;
|
|
|
if (dock.config.position.startsWith("Left")) {
|