mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Merge pull request #17 from janderedev/pr-2
ESC now removes the last attachment. Fixes #16
This commit is contained in:
@@ -477,8 +477,21 @@ export default observer(({ channel }: Props) => {
|
|||||||
return send();
|
return send();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.key === "Escape" && replies.length > 0) {
|
if (e.key === "Escape") {
|
||||||
|
if (replies.length > 0) {
|
||||||
setReplies(replies.slice(0, -1));
|
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);
|
debouncedStopTyping(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user