Skip to content

Commit

Permalink
enhance(frontend): TLの返信表示オプションを記憶するように
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo authored and kanarikanaru committed Oct 13, 2023
1 parent becd661 commit e79f42f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/frontend/src/pages/timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ 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 withReplies = $ref($i ? defaultStore.state.tlWithReplies : false);
const onlyFiles = $ref(false);
watch($$(src), () => queue = 0);
watch($$(withReplies), (x) => {
if ($i) defaultStore.set('tlWithReplies', x);
});
function queueUpdated(q: number): void {
queue = q;
}
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: false,
},
tlWithReplies: {
where: 'device',
default: false,
},
}));

// TODO: 他のタブと永続化されたstateを同期
Expand Down

0 comments on commit e79f42f

Please sign in to comment.