From b38607a6942c068f45fea8ab75329ae8cc48eee7 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Mon, 15 May 2023 18:13:59 -0400 Subject: [PATCH] fix show replies toggle not saving --- packages/client/src/pages/settings/general.vue | 14 ++++++++++++++ packages/client/src/pages/settings/profile.vue | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index 77e51868e..2e1fcda19 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -240,6 +240,20 @@ const useSystemFont = ref(localStorage.getItem("useSystemFont") != null); const profile = reactive({ showTimelineReplies: $i?.showTimelineReplies, }); +watch( + () => profile, + () => { + save(); + }, + { + deep: true, + } +); +function save() { + os.apiWithDialog("i/update", { + showTimelineReplies: !!profile.showTimelineReplies, + }); +} async function reloadAsk() { const { canceled } = await os.confirm({ diff --git a/packages/client/src/pages/settings/profile.vue b/packages/client/src/pages/settings/profile.vue index 981e0124b..17ce2d1c3 100644 --- a/packages/client/src/pages/settings/profile.vue +++ b/packages/client/src/pages/settings/profile.vue @@ -237,7 +237,6 @@ function save() { isBot: !!profile.isBot, isCat: !!profile.isCat, speakAsCat: !!profile.speakAsCat, - showTimelineReplies: !!profile.showTimelineReplies, }); }