From 535a66b87916f94c6933d1142bbec8048a299c1f Mon Sep 17 00:00:00 2001 From: Warrick Corfe-Tan Date: Wed, 30 Jun 2021 15:36:19 +1000 Subject: [PATCH] minor tidying --- ts/components/ConversationListItem.tsx | 8 ++------ .../session/menu/ConversationListItemContextMenu.tsx | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ts/components/ConversationListItem.tsx b/ts/components/ConversationListItem.tsx index 398b699bb..3a56e5997 100644 --- a/ts/components/ConversationListItem.tsx +++ b/ts/components/ConversationListItem.tsx @@ -64,6 +64,7 @@ const ConversationListItem = (props: Props) => { isMe, isPinned, isTyping, + type, lastMessage, memberAvatars, } = props; @@ -72,11 +73,6 @@ const ConversationListItem = (props: Props) => { const dispatch = useDispatch(); - const menuProps: PropsContextConversationItem = { - ...props, - triggerId, - }; - return (
{
- + ); diff --git a/ts/components/session/menu/ConversationListItemContextMenu.tsx b/ts/components/session/menu/ConversationListItemContextMenu.tsx index 542de934b..ac812f1a7 100644 --- a/ts/components/session/menu/ConversationListItemContextMenu.tsx +++ b/ts/components/session/menu/ConversationListItemContextMenu.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { animation, Menu } from 'react-contexify'; +import { useSelector } from 'react-redux'; import { ConversationTypeEnum } from '../../../models/conversation'; +import { getFocusedSection } from '../../../state/selectors/section'; import { SectionType } from '../ActionsPanel'; import { @@ -43,9 +45,7 @@ export const ConversationListItemContextMenu = (props: PropsContextConversationI } = props; const isGroup = type === 'group'; - - const isMessagesSection = - window.inboxStore?.getState().section.focusedSection === SectionType.Message; + const isMessagesSection = useSelector(getFocusedSection) === SectionType.Message; const pinMenuItem = isMessagesSection ? ( ) : null;