Only trap escape key for cancel reply if there is a reply (#11140)

fall through (to clear read marker) otherwise

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
Michael Telatynski 2023-06-28 11:10:45 +01:00 committed by GitHub
parent d404e0656a
commit 3ac9066e46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -351,6 +351,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
} }
break; break;
case KeyBindingAction.CancelReplyOrEdit: case KeyBindingAction.CancelReplyOrEdit:
if (!!this.context.replyToEvent) {
dis.dispatch({ dis.dispatch({
action: "reply_to_event", action: "reply_to_event",
event: null, event: null,
@ -358,6 +359,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
}); });
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
}
break; break;
} }
}; };