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( const handleSubmit = useCallback(
(message: string, mentions: Array<BodyRangeType>, timestamp: number) => { (message: string, mentions: Array<BodyRangeType>, timestamp: number) => {
setLarge(false);
onSendMessage({ onSendMessage({
draftAttachments, draftAttachments,
mentions, mentions,
message, message,
timestamp, timestamp,
}); });
setLarge(false);
}, },
[draftAttachments, onSendMessage, setLarge] [draftAttachments, onSendMessage, setLarge]
); );

View file

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