Skip to content

Commit

Permalink
fix: hide reply and forward actions for messages opened on separated …
Browse files Browse the repository at this point in the history
…tabs
  • Loading branch information
gnekoz committed Sep 3, 2024
1 parent 6deb4f8 commit f8ad1e2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/views/app/detail-panel/preview/mail-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { MessageActionsDescriptors } from '../../../../constants';
import { getAttachmentParts } from '../../../../helpers/attachments';
import { getFolderIdParts } from '../../../../helpers/folders';
import { useAppDispatch } from '../../../../hooks/redux';
import { useMessageActions } from '../../../../hooks/use-message-actions';
import { useRequestDebouncedMessage } from '../../../../hooks/use-request-debounced-message';
import SharedInviteReply from '../../../../integrations/shared-invite-reply';
import { msgAction } from '../../../../store/actions';
Expand Down Expand Up @@ -250,11 +249,6 @@ const MailPreviewBlock: FC<MailPreviewBlockType> = ({
MessageActionsDescriptors.MARK_AS_NOT_SPAM.id
);

const isInside = useMessageActions({
message,
isAlone: true,
isForExtraWindow: true
});
return (
<>
{getFolderIdParts(folderId).id === FOLDERS.SPAM && (
Expand Down
10 changes: 7 additions & 3 deletions src/views/app/folder-panel/messages/message-list-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export const MessageListItem: FC<MessageListItemProps> = memo(function MessageLi
const dispatch = useAppDispatch();
const zimbraPrefMarkMsgRead = useUserSettings()?.prefs?.zimbraPrefMarkMsgRead !== '-1';
const { createWindow } = useGlobalExtraWindowManager();
const messageActions = useMessageActions({ message: item, isAlone: true });
const messageActionsForExtraWindow = useMessageActions({
message: item,
isAlone: true,
isForExtraWindow: true
});

const debouncedPushHistory = useMemo(
() =>
Expand Down Expand Up @@ -108,12 +112,12 @@ export const MessageListItem: FC<MessageListItemProps> = memo(function MessageLi
firstChildFolderId,
item.subject,
createWindow,
messageActions
messageActionsForExtraWindow
).onClick();
}
}
},
[createWindow, debouncedPushHistory, firstChildFolderId, item, messageActions]
[createWindow, debouncedPushHistory, firstChildFolderId, item, messageActionsForExtraWindow]
);

const accounts = useUserAccounts();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ export const ListItemActionWrapper: FC<ListItemActionWrapperProps> = ({
active,
deselectAll
}) => {
const messageActions = useMessageActions({
const messageActionsForExtraWindow = useMessageActions({
message: isConversation(item) ? undefined : item,
isAlone: true
isAlone: true,
isForExtraWindow: true
});

const [hoverActions, dropdownActions] = useMsgConvActions({
item,
deselectAll,
messageActionsForExtraWindow: messageActions
messageActionsForExtraWindow
});
const finalDropdownActions = dropdownActions.filter(
(action: MessageAction) => action.id !== MessageActionsDescriptors.CREATE_APPOINTMENT.id
Expand Down

0 comments on commit f8ad1e2

Please sign in to comment.