From 5464e8a728ecfb70435773d57973ffe9de0946d4 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 27 Jul 2022 19:24:51 -0700 Subject: [PATCH] Toggleable showing updates --- locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + package.json | 2 +- packages/client/src/init.ts | 5 ++--- packages/client/src/pages/settings/general.vue | 3 +++ packages/client/src/store.ts | 5 ++++- 6 files changed, 12 insertions(+), 5 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index b8e8fe1bd..7a064d2a0 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -905,6 +905,7 @@ customMOTD: "Custom MOTD (splash screen messages)" customMOTDDescription: "Custom messages for the MOTD (splash screen) separated by line breaks to be shown randomly every time a user loads/reloads the page." customSplashIcons: "Custom splash screen icons (urls)" customSplashIconsDescription: "URLs for custom splash screen icons separated by line breaks to be shown randomly every time a user loads/reloads the page. Please make sure the images are on a static URL, preferably all resized to 192x192." +showUpdates: "Show a popup when Calckey updates" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing NSFW media via Machine Learning. This will slightly increase the load on the server." diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ff96cc77c..805827d80 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -905,6 +905,7 @@ customMOTD: "カスタムMOTD(スプラッシュスクリーンメッセージ customMOTDDescription: "ユーザがページをロード/リロードするたびにランダムに表示される、改行で区切られたMOTD(スプラッシュスクリーン)用のカスタムメッセージ" customSplashIcons: "カスタムスプラッシュスクリーンアイコン" customSplashIconsDescription: "ユーザがページをロード/リロードするたびにランダムに表示される、改行で区切られたカスタムスプラッシュスクリーンアイコンの URL。画像は静的なURLで、できればすべて192x192にリサイズしてください。" +showUpdates: "Calckeyの更新時にポップアップを表示する" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/package.json b/package.json index 0dc876bd3..244296b0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.0-calc.12.b4", + "version": "12.118.0-calc.13.b4", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index 896dfe295..f121ad4ce 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -237,17 +237,16 @@ import { getAccountFromId } from '@/scripts/get-account-from-id'; // テーマリビルドするため localStorage.removeItem('theme'); - /* try { // 変なバージョン文字列来るとcompareVersionsでエラーになるため - if (lastVersion != null && compareVersions(version, lastVersion) === 1) { + if (lastVersion != null && compareVersions(version, lastVersion) === 1 && defaultStore.state.showUpdates) { // ログインしてる場合だけ if ($i) { popup(defineAsyncComponent(() => import('@/components/updated.vue')), {}, {}, 'closed'); } } } catch (err) { + console.error(err); } - */ } // NOTE: この処理は必ず↑のクライアント更新時処理より後に来ること(テーマ再構築のため) diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 6a498e9ae..021f19b12 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -56,6 +56,7 @@
{{ i18n.ts.disableDrawer }} + {{ i18n.ts.showUpdates }} {{ i18n.ts.aiChanMode }} @@ -144,6 +145,7 @@ const enableInfiniteScroll = computed(defaultStore.makeGetterSetter('enableInfin const enterSendsMessage = computed(defaultStore.makeGetterSetter('enterSendsMessage')); const useReactionPickerForContextMenu = computed(defaultStore.makeGetterSetter('useReactionPickerForContextMenu')); const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars')); +const showUpdates = computed(defaultStore.makeGetterSetter('showUpdates')); const aiChanMode = computed(defaultStore.makeGetterSetter('aiChanMode')); watch(lang, () => { @@ -178,6 +180,7 @@ watch([ instanceTicker, overridedDeviceKind, showAds, + showUpdates, ], async () => { await reloadAsk(); }); diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 5c340cac0..3b95e6531 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -67,7 +67,6 @@ export const defaultStore = markRaw(new Storage('base', { where: 'account', default: true, }, - menu: { where: 'deviceAccount', default: [ @@ -256,6 +255,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true, }, + showUpdates: { + where: 'device', + default: false, + }, })); // TODO: 他のタブと永続化されたstateを同期