🐛 The plugin was not executed uninstall() when being uninstalled (#16243)

fix https://github.com/siyuan-note/siyuan/issues/16156
This commit is contained in:
Jeffrey Chen 2025-11-02 17:48:24 +08:00 committed by GitHub
parent a156dc9671
commit 33d63127b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 15 deletions

View file

@ -211,8 +211,11 @@ export const afterLoadPlugin = (plugin: Plugin) => {
};
export const reloadPlugin = async (app: App, data: { upsertPlugins: string[], removePlugins: string[] }) => {
data.removePlugins.concat(data.upsertPlugins).forEach((item) => {
uninstall(app, item);
data.removePlugins.forEach((item) => {
uninstall(app, item, true);
});
data.upsertPlugins.forEach((item) => {
uninstall(app, item, false);
});
loadPlugins(app, data.upsertPlugins).then(() => {
app.plugins.forEach(item => {