On send, disable message field before doing anything async

This commit is contained in:
Scott Nonnenberg 2022-06-13 09:30:14 -07:00 committed by GitHub
parent 740d8e4c96
commit 5c8b4bca7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -270,13 +270,13 @@ export const CompositionArea = ({
const handleSubmit = useCallback(
(message: string, mentions: Array<BodyRangeType>, timestamp: number) => {
setLarge(false);
onSendMessage({
draftAttachments,
mentions,
message,
timestamp,
});
setLarge(false);
},
[draftAttachments, onSendMessage, setLarge]
);

View File

@ -2929,8 +2929,8 @@ export class ConversationView extends window.Backbone.View<ConversationModel> {
this.sendStart = Date.now();
try {
const contacts = await this.getUntrustedContacts(options);
this.disableMessageField();
const contacts = await this.getUntrustedContacts(options);
if (contacts && contacts.length) {
const sendAnyway = await this.showSendAnywayDialog(contacts.models);