Skip to content

Commit

Permalink
Save timeline settings to the account registry
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriha-chan committed Dec 2, 2023
1 parent 8ee8faf commit 967c33e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/frontend/src/pages/timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ 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 withRenotes = $ref($i ? defaultStore.state.tlWithRenotes : true);
const withReplies = $ref($i ? defaultStore.state.tlWithReplies : false);
const withHashtags = $ref($i ? defaultStore.state.tlWithHashtags : true);
const onlyFiles = $ref(false);
Expand All @@ -79,6 +79,10 @@ watch($$(withHashtags), (x) => {
if ($i) defaultStore.set('tlWithHashtags', x);
});

watch($$(withRenotes), (x) => {
if ($i) defaultStore.set('tlWithRenotes', x);
});

function queueUpdated(q: number): void {
queue = q;
}
Expand Down
10 changes: 9 additions & 1 deletion packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,17 @@ export const defaultStore = markRaw(new Storage('base', {
default: false,
},
tlWithReplies: {
where: 'device',
where: 'account',
default: false,
},
tlWithHashtags: {
where: 'account',
default: true,
},
tlWithRenotes: {
where: 'account',
default: true,
},
defaultWithReplies: {
where: 'account',
default: false,
Expand Down

0 comments on commit 967c33e

Please sign in to comment.