From 5c64c54ed6eb08ad1154c4377b7692c14a0c7393 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Wed, 23 Aug 2023 10:56:56 +1000 Subject: [PATCH] fix: admin actions for sogs on msg click --- .../message-content/MessageContextMenu.tsx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ts/components/conversation/message/message-content/MessageContextMenu.tsx b/ts/components/conversation/message/message-content/MessageContextMenu.tsx index 7591a9ac6..c784b0722 100644 --- a/ts/components/conversation/message/message-content/MessageContextMenu.tsx +++ b/ts/components/conversation/message/message-content/MessageContextMenu.tsx @@ -24,18 +24,6 @@ import { showMessageDetailsView, toggleSelectedMessageId, } from '../../../../state/ducks/conversations'; -import { - useSelectedConversationKey, - useSelectedIsBlocked, - useSelectedIsPublic, - useSelectedWeAreAdmin, - useSelectedWeAreModerator, -} from '../../../../state/selectors/selectedConversation'; -import { saveAttachmentToDisk } from '../../../../util/attachmentsUtil'; -import { Reactions } from '../../../../util/reactions'; -import { SessionContextMenuContainer } from '../../../SessionContextMenuContainer'; -import { SessionEmojiPanel, StyledEmojiPanel } from '../../SessionEmojiPanel'; -import { MessageReactBar } from './MessageReactBar'; import { useMessageAttachments, useMessageBody, @@ -48,7 +36,18 @@ import { useMessageStatus, useMessageTimestamp, } from '../../../../state/selectors'; -import { useIsPublic } from '../../../../hooks/useParamSelector'; +import { + useSelectedConversationKey, + useSelectedIsBlocked, + useSelectedIsPublic, + useSelectedWeAreAdmin, + useSelectedWeAreModerator, +} from '../../../../state/selectors/selectedConversation'; +import { saveAttachmentToDisk } from '../../../../util/attachmentsUtil'; +import { Reactions } from '../../../../util/reactions'; +import { SessionContextMenuContainer } from '../../../SessionContextMenuContainer'; +import { SessionEmojiPanel, StyledEmojiPanel } from '../../SessionEmojiPanel'; +import { MessageReactBar } from './MessageReactBar'; export type MessageContextMenuSelectorProps = Pick< MessageRenderingProps, @@ -149,10 +148,11 @@ const SaveAttachment = ({ messageId }: MessageId) => { const AdminActionItems = ({ messageId }: MessageId) => { const convoId = useSelectedConversationKey(); - const isPublic = useIsPublic(); + const isPublic = useSelectedIsPublic(); const weAreModerator = useSelectedWeAreModerator(); const weAreAdmin = useSelectedWeAreAdmin(); const showAdminActions = (weAreAdmin || weAreModerator) && isPublic; + const sender = useMessageSender(messageId); const isSenderAdmin = useMessageSenderIsAdmin(messageId);