From 2232cec2bf72cff54e9950a9d778ed3379022dba Mon Sep 17 00:00:00 2001 From: Vanessa Date: Tue, 26 Dec 2023 16:47:26 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/9943 --- app/src/plugin/index.ts | 1 - app/src/plugin/loader.ts | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts index 2126d47a3..01fe29b70 100644 --- a/app/src/plugin/index.ts +++ b/app/src/plugin/index.ts @@ -65,7 +65,6 @@ export class Plugin { }) { this.app = options.app; this.i18n = options.i18n; - this.name = options.name; this.displayName = options.displayName; this.eventBus = new EventBus(options.name); } diff --git a/app/src/plugin/loader.ts b/app/src/plugin/loader.ts index a63b19bef..4b9104d55 100644 --- a/app/src/plugin/loader.ts +++ b/app/src/plugin/loader.ts @@ -64,6 +64,11 @@ const loadPluginJS = async (app: App, item: IPluginData) => { name: item.name, i18n: item.i18n }); + // https://github.com/siyuan-note/siyuan/issues/9943 + Object.defineProperty(plugin, "name", { + value: item.name, + writable: false, + }); app.plugins.push(plugin); try { await plugin.onload();