Fixed Bug 62398 - Rooms.Archive.Hotkeys. Fixed delete action
This commit is contained in:
parent
9243961017
commit
aa74abbd76
@ -53,7 +53,7 @@ const DeleteDialogComponent = (props) => {
|
||||
|
||||
const onKeyUp = (e) => {
|
||||
if (e.keyCode === 27) onClose();
|
||||
if (e.keyCode === 13 || e.which === 13) onDelete();
|
||||
if (e.keyCode === 13 || e.which === 13) onDeleteAction();
|
||||
};
|
||||
|
||||
const onDelete = () => {
|
||||
@ -170,6 +170,12 @@ const DeleteDialogComponent = (props) => {
|
||||
? t("UnsubscribeButton")
|
||||
: t("MoveToTrashButton");
|
||||
|
||||
const onDeleteAction = () => {
|
||||
if (isRoomDelete) onDeleteRoom();
|
||||
else if (unsubscribe) onUnsubscribe();
|
||||
else onDelete();
|
||||
};
|
||||
|
||||
return (
|
||||
<StyledDeleteDialog isLoading={!tReady} visible={visible} onClose={onClose}>
|
||||
<ModalDialog.Header>{title}</ModalDialog.Header>
|
||||
@ -186,9 +192,7 @@ const DeleteDialogComponent = (props) => {
|
||||
size="normal"
|
||||
primary
|
||||
scale
|
||||
onClick={
|
||||
isRoomDelete ? onDeleteRoom : unsubscribe ? onUnsubscribe : onDelete
|
||||
}
|
||||
onClick={onDeleteAction}
|
||||
isLoading={isLoading}
|
||||
isDisabled={!selection.length}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user