From b1db397923058f9fdcbfa0b6ad4e10b12a5ee666 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Wed, 27 Apr 2022 17:02:12 +0200 Subject: [PATCH] 1.0.1 Added a warning if the old version of Omnisearch is installed --- manifest.json | 2 +- package.json | 2 +- src/main.ts | 17 ++++++++++++++++- versions.json | 3 ++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/manifest.json b/manifest.json index 9f4b0a0..f7f61bd 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "omnisearch", "name": "Omnisearch", - "version": "1.0.0", + "version": "1.0.1", "minAppVersion": "0.14.2", "description": "A search engine that just works", "author": "Simon Cambier", diff --git a/package.json b/package.json index e8feafe..8702c26 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scambier.obsidian-search", - "version": "1.0.0", + "version": "1.0.1", "description": "A search engine for Obsidian", "main": "dist/main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index 2e97d1d..1738168 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { Plugin, TFile } from 'obsidian' +import { Notice, Plugin, TFile } from 'obsidian' import { addToIndex, initGlobalSearchIndex, @@ -9,6 +9,8 @@ import { OmnisearchInFileModal, OmnisearchVaultModal } from './modals' export default class OmnisearchPlugin extends Plugin { async onload(): Promise { + warningOldVersion() + // Commands to display Omnisearch modals this.addCommand({ id: 'show-modal', @@ -57,3 +59,16 @@ export default class OmnisearchPlugin extends Plugin { }) } } + +function warningOldVersion() { + const installed = (app as any).plugins.enabledPlugins as Set + if (installed.has('scambier.omnisearch')) { + new Notice( + `OMNISEARCH +It looks like you have 2 versions of Omnisearch installed. +Please uninstall the old one (up to 0.2.5) and keep the new one (1.0.0+) +(Click to dismiss)`, + 0, + ) + } +} diff --git a/versions.json b/versions.json index ac69b47..e4ffc29 100644 --- a/versions.json +++ b/versions.json @@ -14,5 +14,6 @@ "0.2.3": "0.14.2", "0.2.4": "0.14.2", "0.2.5": "0.14.2", - "1.0.0": "0.14.2" + "1.0.0": "0.14.2", + "1.0.1": "0.14.2" } \ No newline at end of file