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,