From c73be8aecc0cc17be1685cbfb44828b852701457 Mon Sep 17 00:00:00 2001 From: William Grant Date: Thu, 12 Oct 2023 14:02:48 +1100 Subject: [PATCH] fix: use convoId instead of convoName in dep array for what subtitle to show when changing convos --- ts/components/conversation/header/ConversationHeaderTitle.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ts/components/conversation/header/ConversationHeaderTitle.tsx b/ts/components/conversation/header/ConversationHeaderTitle.tsx index 5581e234c..47db01251 100644 --- a/ts/components/conversation/header/ConversationHeaderTitle.tsx +++ b/ts/components/conversation/header/ConversationHeaderTitle.tsx @@ -6,6 +6,7 @@ import { closeRightPanel, openRightPanel } from '../../../state/ducks/conversati import { resetRightOverlayMode, setRightOverlayMode } from '../../../state/ducks/section'; import { useSelectedConversationDisappearingMode, + useSelectedConversationKey, useSelectedExpireTimer, useSelectedIsGroup, useSelectedIsKickedFromGroup, @@ -33,6 +34,7 @@ export type SubtitleStringsType = keyof Pick< // tslint:disable: cyclomatic-complexity max-func-body-length export const ConversationHeaderTitle = () => { const dispatch = useDispatch(); + const convoId = useSelectedConversationKey(); const convoName = useSelectedNicknameOrProfileNameOrShortenedPubkey(); const notificationSetting = useSelectedNotificationSetting(); @@ -129,7 +131,7 @@ export const ConversationHeaderTitle = () => { } // We only want this to change when a new conversation is selected or disappearing messages is toggled // eslint-disable-next-line react-hooks/exhaustive-deps - }, [convoName, disappearingMessageSubtitle]); + }, [convoId, disappearingMessageSubtitle]); useEffect(() => { const newSubtitlesArray: any = [];