From 004fcd97751f252b9e99ba89ab2f5f9de729b325 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Wed, 27 Apr 2022 21:06:50 +0200 Subject: [PATCH] Different method to check dupe installation app.plugins.enabledPlugins seems buggy when a plugin is not correctly deleted --- src/main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 1738168..65b63b0 100644 --- a/src/main.ts +++ b/src/main.ts @@ -60,9 +60,9 @@ export default class OmnisearchPlugin extends Plugin { } } -function warningOldVersion() { - const installed = (app as any).plugins.enabledPlugins as Set - if (installed.has('scambier.omnisearch')) { +function warningOldVersion(): void { + const plugins = ((app as any).plugins?.plugins ?? {}) as Record + if (plugins['scambier.omnisearch']) { new Notice( `OMNISEARCH It looks like you have 2 versions of Omnisearch installed.