From f4361c95e2683f84a5e6271811d999ff101fa41e Mon Sep 17 00:00:00 2001 From: mara-li Date: Wed, 7 Aug 2024 10:18:17 +0200 Subject: [PATCH] fix: crash onunload with activemonkey --- src/main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 08456e1..34c9195 100644 --- a/src/main.ts +++ b/src/main.ts @@ -430,10 +430,11 @@ export default class EnhancedCopy extends Plugin { }, }); } - onunload() { + async onunload() { console.log(`CopyReadingInMarkdown v.${this.manifest.version} unloaded.`); for (const monkey of Object.values(this.activeMonkeys)) { - monkey(); + const actived = await monkey.remove; + if (actived) await monkey.remove(); } } async loadSettings() {