From ac1367a0b9ad5da2870af540fce50ab324a3a9f1 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Sat, 30 Sep 2023 19:02:17 +0900 Subject: [PATCH] =?UTF-8?q?TL=E3=81=AE=E7=B5=9E=E3=82=8A=E8=BE=BC=E3=81=BF?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 4 +++- locales/ja-JP.yml | 2 ++ packages/frontend/src/pages/settings/general.vue | 4 +++- packages/frontend/src/pages/timeline.vue | 8 ++++---- packages/frontend/src/store.ts | 16 ++++++++++++++++ 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index c23cdb5bb6..47e542d4e3 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -13,7 +13,6 @@ export interface Locale { "password": string; "forgotPassword": string; "fetchingAsApObject": string; - "fileAttachedOnly": string; "ok": string; "gotIt": string; "cancel": string; @@ -677,6 +676,7 @@ export interface Locale { "forwardReport": string; "forwardReportIsAnonymous": string; "send": string; + "fileAttachedOnly": string; "abuseMarkAsResolved": string; "openInNewTab": string; "openInSideView": string; @@ -709,6 +709,8 @@ export interface Locale { "sentReactionsCount": string; "receivedReactionsCount": string; "pollVotesCount": string; + "onlyAndWithSave": string; + "onlyAndWithSaveInfo": string; "pollVotedCount": string; "yes": string; "no": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index dada9d8869..ed24aa9e85 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -706,6 +706,8 @@ followersCount: "フォロワー数" sentReactionsCount: "リアクションした数" receivedReactionsCount: "リアクションされた数" pollVotesCount: "アンケートに投票した数" +onlyAndWithSave: "タイムラインの絞り込みを保存する" +onlyAndWithSaveInfo: "ファイルのみ や リプライのみ などが保存されるようになります" pollVotedCount: "アンケートに投票された数" yes: "はい" no: "いいえ" diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index e808e9b6af..d9279d8bb8 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -139,7 +139,7 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.UltimateDataSaver }} {{ i18n.ts.cellularWithUltimateDataSaver }} {{ i18n.ts.gamingMode }} - + {{ i18n.ts.onlyAndWithSave}}
@@ -283,6 +283,7 @@ const notificationPosition = computed(defaultStore.makeGetterSetter('notificatio const notificationStackAxis = computed(defaultStore.makeGetterSetter('notificationStackAxis')); const keepScreenOn = computed(defaultStore.makeGetterSetter('keepScreenOn')); const enableGamingMode = computed(defaultStore.makeGetterSetter('gamingMode')); +const enableonlyAndWithSave = computed(defaultStore.makeGetterSetter('onlyAndWithSave')); const showMediaTimeline = computed(defaultStore.makeGetterSetter('showMediaTimeline')); const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibilityColor')) watch(lang, () => { @@ -345,6 +346,7 @@ watch([ keepScreenOn, showMediaTimeline, showVisibilityColor, + enableonlyAndWithSave, ], async () => { await reloadAsk(); }); diff --git a/packages/frontend/src/pages/timeline.vue b/packages/frontend/src/pages/timeline.vue index 3523603b3d..e7a6f82927 100644 --- a/packages/frontend/src/pages/timeline.vue +++ b/packages/frontend/src/pages/timeline.vue @@ -63,10 +63,10 @@ const rootEl = $shallowRef(); let queue = $ref(0); let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global'); const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); -const withRenotes = $ref(true); -const withReplies = $ref(false); -const onlyFiles = $ref(false); - +const withRenotes = $ref(defaultStore.state.onlyAndWithSave ? computed(defaultStore.makeGetterSetter('withRenotes')) : true); +const withReplies = $ref(defaultStore.state.onlyAndWithSave ? computed(defaultStore.makeGetterSetter('withReplies')) : false); +const onlyFiles = $ref(defaultStore.state.onlyAndWithSave ? computed(defaultStore.makeGetterSetter('onlyFiles')) : false); +console.log(defaultStore.state.onlyAndWithSave) watch($$(src), () => queue = 0); function queueUpdated(q: number): void { diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 2ab8fb3593..e086d58b00 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -364,6 +364,22 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: 44, }, + onlyAndWithSave:{ + where: 'device', + default: true, + }, + onlyFiles:{ + where: 'device', + default: false, + }, + withReplies:{ + where: 'device', + default: false, + }, + withRenotes:{ + where: 'device', + default: true, + }, showNoteActionsOnlyHover: { where: 'device', default: false,