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

Re-focus the composer on dialogue quit #10007

Merged
merged 5 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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