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,