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

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,