TLの絞り込み保存できるようにした

This commit is contained in:
mattyatea 2023-09-30 19:02:17 +09:00
parent 2d815c72cb
commit ac1367a0b9
5 changed files with 28 additions and 6 deletions

4
locales/index.d.ts vendored
View File

@ -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;

View File

@ -706,6 +706,8 @@ followersCount: "フォロワー数"
sentReactionsCount: "リアクションした数"
receivedReactionsCount: "リアクションされた数"
pollVotesCount: "アンケートに投票した数"
onlyAndWithSave: "タイムラインの絞り込みを保存する"
onlyAndWithSaveInfo: "ファイルのみ や リプライのみ などが保存されるようになります"
pollVotedCount: "アンケートに投票された数"
yes: "はい"
no: "いいえ"

View File

@ -139,7 +139,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="enableUltimateDataSaverMode">{{ i18n.ts.UltimateDataSaver }}</MkSwitch>
<MkSwitch v-model="enableCellularWithUltimateDataSaver">{{ i18n.ts.cellularWithUltimateDataSaver }}</MkSwitch>
<MkSwitch v-model="enableGamingMode">{{ i18n.ts.gamingMode }} <template #caption>{{ i18n.ts.gamingModeInfo }} </template></MkSwitch>
<MkSwitch v-model="enableonlyAndWithSave">{{ i18n.ts.onlyAndWithSave}}<template #caption>{{ i18n.ts.onlyAndWithSaveInfo }} </template></MkSwitch>
</div>
<div>
<MkRadios v-model="emojiStyle">
@ -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();
});

View File

@ -63,10 +63,10 @@ const rootEl = $shallowRef<HTMLElement>();
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 {

View File

@ -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,