feat: add shortcut for "save and submit" when editing message (#127)

save and submit the edited message when ctrl and shift key been pressed simultaneously.

Co-authored-by: Jing Hua <59118459+ztjhz@users.noreply.github.com>
This commit is contained in:
akira0245 2023-03-30 16:06:51 +08:00 committed by GitHub
parent 78bf777365
commit 63596c20d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -353,8 +353,12 @@ const EditView = ({
handleSaveAndSubmit(); handleSaveAndSubmit();
resetTextAreaHeight(); resetTextAreaHeight();
} }
} else if (e.ctrlKey || e.shiftKey) { } else {
handleSave(); if (e.ctrlKey && e.shiftKey) {
e.preventDefault();
handleSaveAndSubmit();
resetTextAreaHeight();
} else if (e.ctrlKey || e.shiftKey) handleSave();
} }
} }
}; };