mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 15:32:11 -05:00
ESC now removes the last attachment. Fixes #16
This commit is contained in:
parent
8d65e1ee11
commit
cae3b68c7f
1 changed files with 15 additions and 2 deletions
|
@ -477,8 +477,21 @@ export default observer(({ channel }: Props) => {
|
|||
return send();
|
||||
}
|
||||
|
||||
if (e.key === "Escape" && replies.length > 0) {
|
||||
setReplies(replies.slice(0, -1));
|
||||
if (e.key === "Escape") {
|
||||
if (replies.length > 0) {
|
||||
setReplies(replies.slice(0, -1));
|
||||
} else if (
|
||||
uploadState.type === "attached" &&
|
||||
uploadState.files.length > 0
|
||||
) {
|
||||
setUploadState({
|
||||
type:
|
||||
uploadState.files.length > 1
|
||||
? "attached"
|
||||
: "none",
|
||||
files: uploadState.files.slice(0, -1),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
debouncedStopTyping(true);
|
||||
|
|
Loading…
Reference in a new issue