diff --git a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx index 8589f9be0..c8e69fc72 100644 --- a/ts/components/leftpane/conversation-list-item/HeaderItem.tsx +++ b/ts/components/leftpane/conversation-list-item/HeaderItem.tsx @@ -11,7 +11,8 @@ import { ContextConversationId } from './ConversationListItem'; import { UserItem } from './UserItem'; const NotificationSettingIcon = (props: { isMessagesSection: boolean }) => { - const convoSetting = useSelector(useConversationPropsById)?.currentNotificationSetting; + const convoId = useContext(ContextConversationId); + const convoSetting = useConversationPropsById(convoId)?.currentNotificationSetting; if (!props.isMessagesSection) { return null; diff --git a/ts/components/menu/Menu.tsx b/ts/components/menu/Menu.tsx index da980d193..f148a6b5c 100644 --- a/ts/components/menu/Menu.tsx +++ b/ts/components/menu/Menu.tsx @@ -155,11 +155,11 @@ export const getPinConversationMenuItem = (conversationId: string): JSX.Element if (isMessagesSection) { const conversation = getConversationController().get(conversationId); - const isPinned = conversation.isPinned(); + const isPinned = conversation?.isPinned() || false; const togglePinConversation = async () => { if ((!isPinned && nbOfAlreadyPinnedConvos < maxNumberOfPinnedConversations) || isPinned) { - await conversation.setIsPinned(!isPinned); + await conversation?.setIsPinned(!isPinned); } else { ToastUtils.pushToastWarning( 'pinConversationLimitToast',