Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Re-focus the composer on dialogue quit (#10007)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Telatynski <[email protected]>
  • Loading branch information
Ashu999 and t3chguy authored Feb 16, 2023
1 parent 4574c66 commit cf7ab9a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/views/rooms/EditMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
10 changes: 8 additions & 2 deletions src/components/views/rooms/SendMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit cf7ab9a

Please sign in to comment.