From 453a023cb95008761cfe2e8471f12328800d0398 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 18 May 2024 17:19:17 +0100 Subject: [PATCH] correcty load/save `withBots` - fixes #528 there is no `tlWithBots` setting, it's inside `tl.filter` and we need more complicated code to set it --- packages/frontend/src/pages/settings/general.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 1e4e815d5d..f404e3265f 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -293,6 +293,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js'; import { miLocalStorage } from '@/local-storage.js'; import { globalEvents } from '@/events.js'; import { claimAchievement } from '@/scripts/achievements.js'; +import { deepMerge } from '@/scripts/merge.js'; const lang = ref(miLocalStorage.getItem('lang')); const fontSize = ref(miLocalStorage.getItem('fontSize')); @@ -319,7 +320,14 @@ const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDi const limitWidthOfReaction = computed(defaultStore.makeGetterSetter('limitWidthOfReaction')); const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes')); const clickToOpen = computed(defaultStore.makeGetterSetter('clickToOpen')); -const showBots = computed(defaultStore.makeGetterSetter('tlWithBots')); +// copied from src/pages/timeline.vue +const showBots = computed({ + get: () => defaultStore.reactiveState.tl.value.filter.withBots, + set: (newValue) => { + const out = deepMerge({ filter: { withBots: newValue } }, defaultStore.state.tl); + defaultStore.set('tl', out); + }, +}); const collapseFiles = computed(defaultStore.makeGetterSetter('collapseFiles')); const autoloadConversation = computed(defaultStore.makeGetterSetter('autoloadConversation')); const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v));