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/10203

Vanessa3653445abc93
diff --git a/app/src/index.ts b/app/src/index.ts
index 40b05d9dd0..b285206f3a 100644
--- a/app/src/index.ts
+++ b/app/src/index.ts
@@ -25,7 +25,8 @@ import {getAllTabs} from "./layout/getAll";
import {getLocalStorage} from "./protyle/util/compatibility";
import {getSearch} from "./util/functions";
import {hideAllElements} from "./protyle/ui/hideElements";
-import {loadPlugins} from "./plugin/loader";
+import {afterLoadPlugin, loadPlugins} from "./plugin/loader";
+import {uninstall} from "./plugin/uninstall";
import "./assets/scss/base.scss";
export class App {
@@ -59,6 +60,16 @@ export class App {
});
if (data) {
switch (data.cmd) {
+ case "reloadPlugin":
+ this.plugins.forEach((plugin) => {
+ uninstall(this, plugin.name);
+ });
+ loadPlugins(this).then(() => {
+ this.plugins.forEach(item => {
+ afterLoadPlugin(item);
+ });
+ });
+ break;
case "syncMergeResult":
reloadSync(this, data.data);
break;
@@ -151,7 +162,7 @@ export class App {
window.siyuan.config = response.data.conf;
await loadPlugins(this);
getLocalStorage(() => {
- fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages:IObject) => {
+ fetchGet(`/appearance/langs/${window.siyuan.config.appearance.lang}.json?v=${Constants.SIYUAN_VERSION}`, (lauguages: IObject) => {
window.siyuan.languages = lauguages;
window.siyuan.menus = new Menus(this);
bootSync();