mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
Fix executing the uninstall method when closing the plugin (#16522)
* 🐛 Fix executing the uninstall method when closing the plugin
* 后端推送区分插件禁用与卸载
This commit is contained in:
parent
ab62a13cb0
commit
ec881a76af
5 changed files with 54 additions and 26 deletions
|
|
@ -225,10 +225,16 @@ export const afterLoadPlugin = (plugin: Plugin) => {
|
|||
export const reloadPlugin = async (app: App, data: {
|
||||
upsertCodePlugins?: string[],
|
||||
upsertDataPlugins?: string[],
|
||||
removePlugins?: string[]
|
||||
unloadPlugins?: string[],
|
||||
uninstallPlugins?: string[],
|
||||
} = {}) => {
|
||||
const {upsertCodePlugins = [], upsertDataPlugins = [], removePlugins = []} = data;
|
||||
removePlugins.forEach((item) => {
|
||||
const {upsertCodePlugins = [], upsertDataPlugins = [], unloadPlugins = [], uninstallPlugins = []} = data;
|
||||
// 禁用
|
||||
unloadPlugins.forEach((item) => {
|
||||
uninstall(app, item, true);
|
||||
});
|
||||
// 卸载
|
||||
uninstallPlugins.forEach((item) => {
|
||||
uninstall(app, item, false);
|
||||
});
|
||||
upsertCodePlugins.forEach((item) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue