fix: no need to handle Delete key in convo now

the focustrap on the selection overlay will grab the keys and do the
acitons when it is mounted
pull/3061/head
Audric Ackermann 2 months ago
parent f7d574ce20
commit a52ed6490a

@ -53,7 +53,6 @@ import { LightboxGallery, MediaItemType } from '../lightbox/LightboxGallery';
import { NoMessageInConversation } from './SubtleNotification';
import { ConversationHeaderWithDetails } from './header/ConversationHeader';
import { deleteMessagesForX } from '../../interactions/conversations/unsendingInteractions';
import { isAudio } from '../../types/MIME';
import { HTMLDirection } from '../../util/i18n';
import { NoticeBanner } from '../NoticeBanner';
@ -85,7 +84,6 @@ interface Props {
stagedAttachments: Array<StagedAttachmentType>;
isSelectedConvoInitialLoadingInProgress: boolean;
isPublic: boolean;
}
const StyledSpinnerContainer = styled.div`
@ -346,7 +344,6 @@ export class SessionConversation extends React.Component<Props, State> {
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
private onKeyDown(event: any) {
const selectionMode = !!this.props.selectedMessages.length;
const { selectedConversationKey, selectedMessages, isPublic } = this.props;
if (event.target.classList.contains('conversation-content')) {
switch (event.key) {
@ -355,13 +352,8 @@ export class SessionConversation extends React.Component<Props, State> {
window.inboxStore?.dispatch(resetSelectedMessageIds());
}
break;
case 'Backspace':
case 'Delete':
if (selectionMode && this.props.selectedConversationKey) {
void deleteMessagesForX(selectedMessages, selectedConversationKey, isPublic);
}
break;
default:
break;
}
}
}

@ -12,10 +12,7 @@ import {
getSortedMessagesOfSelectedConversation,
isRightPanelShowing,
} from '../selectors/conversations';
import {
getSelectedConversationIsPublic,
getSelectedConversationKey,
} from '../selectors/selectedConversation';
import { getSelectedConversationKey } from '../selectors/selectedConversation';
import { getStagedAttachmentsForCurrentConversation } from '../selectors/stagedAttachments';
import { getTheme } from '../selectors/theme';
import { getOurDisplayNameInProfile, getOurNumber } from '../selectors/user';
@ -39,7 +36,6 @@ const mapStateToProps = (state: StateType, ownProps: SmartSessionConversationOwn
hasOngoingCallWithFocusedConvo: getHasOngoingCallWithFocusedConvo(state),
isSelectedConvoInitialLoadingInProgress: getIsSelectedConvoInitialLoadingInProgress(state),
htmlDirection: ownProps.htmlDirection,
isPublic: getSelectedConversationIsPublic(state),
};
};

Loading…
Cancel
Save