On send, disable message field before doing anything async
This commit is contained in:
parent
740d8e4c96
commit
5c8b4bca7e
2 changed files with 2 additions and 2 deletions
|
@ -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]
|
||||||
);
|
);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue