From 797218b86394ed421aebc3d0212eeadd4d13e098 Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 19 Oct 2023 14:27:25 +0900 Subject: [PATCH] chore: minor refactor on version comparison --- packages/client/package.json | 1 - packages/client/src/init.ts | 27 +++++++-------------------- pnpm-lock.yaml | 7 ------- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/packages/client/package.json b/packages/client/package.json index 6d18c35b4..f6d457835 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -43,7 +43,6 @@ "chartjs-plugin-gradient": "0.6.1", "chartjs-plugin-zoom": "2.0.1", "city-timezones": "^1.2.1", - "compare-versions": "6.1.0", "cropperjs": "2.0.0-beta.4", "cross-env": "7.0.3", "date-fns": "2.30.0", diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 7cb94adb7..a3287c461 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -31,7 +31,6 @@ import { version as vueVersion, watch, } from "vue"; -import { compareVersions } from "compare-versions"; import widgets from "@/widgets"; import directives from "@/directives"; @@ -250,25 +249,13 @@ function checkForSplash() { // テーマリビルドするため localStorage.removeItem("theme"); - try { - // 変なバージョン文字列来るとcompareVersionsでエラーになるため - if ( - lastVersion != null && - version !== lastVersion && - defaultStore.state.showUpdates - ) { - // ログインしてる場合だけ - if ($i) { - popup( - defineAsyncComponent(() => import("@/components/MkUpdated.vue")), - {}, - {}, - "closed", - ); - } - } - } catch (err) { - console.error(err); + if ($i && defaultStore.state.showUpdates) { + popup( + defineAsyncComponent(() => import("@/components/MkUpdated.vue")), + {}, + {}, + "closed", + ); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d8742ba96..f5b2fa4eb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -713,9 +713,6 @@ importers: city-timezones: specifier: ^1.2.1 version: 1.2.1 - compare-versions: - specifier: 6.1.0 - version: 6.1.0 cropperjs: specifier: 2.0.0-beta.4 version: 2.0.0-beta.4 @@ -6423,10 +6420,6 @@ packages: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} dev: true - /compare-versions@6.1.0: - resolution: {integrity: sha512-LNZQXhqUvqUTotpZ00qLSaify3b4VFD588aRr8MKFw4CMUr98ytzCW5wDH5qx/DEY5kCDXcbcRuCqL0szEf2tg==} - dev: true - /component-emitter@1.3.0: resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} dev: true