From 1b558e7243992d97f971fa2caec2b21a65cfe8ff Mon Sep 17 00:00:00 2001 From: mattyatea Date: Thu, 19 Oct 2023 02:17:16 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20=E3=82=B0=E3=83=AD=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=AB=E3=82=BF=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E3=81=AE=E8=A1=A8=E7=A4=BA=E9=9D=9E=E8=A1=A8=E7=A4=BA=E3=82=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + packages/frontend/src/pages/settings/general.vue | 4 +++- packages/frontend/src/pages/timeline.vue | 4 ++-- packages/frontend/src/store.ts | 4 ++++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 2a400035bf..791ae673c4 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -21,6 +21,7 @@ export interface Locale { "cancel": string; "noThankYou": string; "enterUsername": string; + "showGlobalTimeline": string; "renotedBy": string; "noNotes": string; "noNotifications": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 3506689a66..eebd1a5830 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -18,6 +18,7 @@ gotIt: "わかった" cancel: "キャンセル" noThankYou: "やめておく" enterUsername: "ユーザー名を入力" +showGlobalTimeline: "グローバルタイムラインを表示する" renotedBy: "{user}がリノート" noNotes: "ノートはありません" noNotifications: "通知はありません" diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index ddff3fd16e..59a53b5657 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -32,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.withRepliesByDefaultForNewlyFollowed }} {{ i18n.ts.showMediaTimeline}} {{ i18n.ts.FeaturedOrNote}} - + {{ i18n.ts.showGlobalTimeline }} @@ -289,6 +289,7 @@ const enableGamingMode = computed(defaultStore.makeGetterSetter('gamingMode')); const enableonlyAndWithSave = computed(defaultStore.makeGetterSetter('onlyAndWithSave')); const enablehanntenn = computed(defaultStore.makeGetterSetter('enablehanntenn')); const showMediaTimeline = computed(defaultStore.makeGetterSetter('showMediaTimeline')); +const showGlobalTimeline = computed(defaultStore.makeGetterSetter('showGlobalTimeline')); const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibilityColor')) const FeaturedOrNote = computed(defaultStore.makeGetterSetter('FeaturedOrNote')) const defaultWithReplies = computed(defaultStore.makeGetterSetter('defaultWithReplies')); @@ -355,6 +356,7 @@ watch([ showVisibilityColor, enableonlyAndWithSave, FeaturedOrNote, + showGlobalTimeline ], async () => { await reloadAsk(); }); diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index f719e6a960..5b6dc80e59 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -50,7 +50,7 @@ provide('shouldOmitHeaderTitle', true); const XTutorial = defineAsyncComponent(() => import('./timeline.tutorial.vue')); const isLocalTimelineAvailable = ($i == null && instance.policies.ltlAvailable) || ($i != null && $i.policies.ltlAvailable); -const isGlobalTimelineAvailable = ($i == null && instance.policies.gtlAvailable) || ($i != null && $i.policies.gtlAvailable); +const isGlobalTimelineAvailable = ($i == null && instance.policies.gtlAvailable && defaultStore.state.showGlobalTimeline) || ($i != null && $i.policies.gtlAvailable && defaultStore.state.showGlobalTimeline); const keymap = { 't': focus, }; @@ -190,7 +190,7 @@ const headerTabs = $computed(() => [...(defaultStore.reactiveState.pinnedUserLis title: i18n.ts._timelines.social, icon: 'ti ti-rocket', iconOnly: true, -}] : []), ...(isGlobalTimelineAvailable ? [{ +}] : []), ...(isGlobalTimelineAvailable ? [{ key: 'global', title: i18n.ts._timelines.global, icon: 'ti ti-whirl', diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 63b64601db..ae29849d55 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -396,6 +396,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true, }, + showGlobalTimeline:{ + where: 'device', + default: true, + }, showVisibilityColor:{ where: 'device', default: false,