From ea1583dcac1510b49beaf027fea68fe2173edd72 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 13 Sep 2022 16:24:19 -0400 Subject: [PATCH] Fix chat silence bug --- app/soapbox/queries/chats.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/soapbox/queries/chats.ts b/app/soapbox/queries/chats.ts index 738e0ca21..cc910b9c6 100644 --- a/app/soapbox/queries/chats.ts +++ b/app/soapbox/queries/chats.ts @@ -190,6 +190,8 @@ const useChatSilences = () => { const data = await getChatSilences(); if (data) { setSilenced(true); + } else { + setSilenced(false); } }; @@ -228,8 +230,10 @@ const useChatSilences = () => { }; useEffect(() => { - fetchChatSilence(); - }, []); + if (chat?.id) { + fetchChatSilence(); + } + }, [chat]); return { isSilenced, handleSilence }; };