Improve onDataChanged method (#16472)

* 🐛 Improve onDataChanged method

fix https://github.com/siyuan-note/siyuan/pull/16244

重构、修复插件重启逻辑

重构

比如插件在 onload() 中插入了图标,uninstall 会把图标删除,afterLoadPlugin 又不能执行 onload() 把图标加回来

使用 getElementById

先加载插件样式

避免插入重复的样式

改进插件样式插入位置

* reloadPlugin
This commit is contained in:
Jeffrey Chen 2025-12-02 09:57:50 +08:00 committed by GitHub
parent d620daa530
commit bcdef64d0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 60 additions and 37 deletions

View file

@ -22,7 +22,7 @@ import {
import {initMessage} from "../dialog/message";
import {getAllTabs} from "../layout/getAll";
import {getLocalStorage} from "../protyle/util/compatibility";
import {init} from "../window/init";
import {init} from "./init";
import {loadPlugins, reloadPlugin} from "../plugin/loader";
import {hideAllElements} from "../protyle/ui/hideElements";
import {reloadEmoji} from "../emoji";