Re-focus the composer on dialogue quit (#10007)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
t3chguy/dedup-icons-17oct
Ashutosh Sharma 2023-02-16 23:34:46 +05:30 committed by GitHub
parent 4574c665ea
commit cf7ab9a8c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -339,9 +339,15 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
} else {
shouldSend = false;
}
} else if (!(await shouldSendAnyway(commandText))) {
} else {
const sendAnyway = await shouldSendAnyway(commandText);
// re-focus the composer after QuestionDialog is closed
dis.dispatch({
action: Action.FocusAComposer,
context: this.context.timelineRenderingType,
});
// if !sendAnyway bail to let the user edit the composer and try again
return;
if (!sendAnyway) return;
}
}
if (shouldSend) {

View File

@ -385,9 +385,15 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
} else {
shouldSend = false;
}
} else if (!(await shouldSendAnyway(commandText))) {
} else {
const sendAnyway = await shouldSendAnyway(commandText);
// re-focus the composer after QuestionDialog is closed
dis.dispatch({
action: Action.FocusAComposer,
context: this.context.timelineRenderingType,
});
// if !sendAnyway bail to let the user edit the composer and try again
return;
if (!sendAnyway) return;
}
}