1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-28 15:22:05 +03:00

Call onCloseDialog straigh away

This avoids some delay in the dialog disappearing

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-04-13 08:04:50 +02:00
parent 86dd81cda0
commit f1c80fcede

View File

@ -144,13 +144,13 @@ export default class MessageContextMenu extends React.Component {
const cli = MatrixClientPeg.get();
try {
if (this.props.onCloseDialog) this.props.onCloseDialog();
await cli.redactEvent(
this.props.mxEvent.getRoomId(),
this.props.mxEvent.getId(),
undefined,
reason ? { reason } : {},
);
if (this.props.onCloseDialog) this.props.onCloseDialog();
} catch (e) {
const code = e.errcode || e.statusCode;
// only show the dialog if failing for something other than a network error
@ -194,11 +194,11 @@ export default class MessageContextMenu extends React.Component {
};
onForwardClick = () => {
if (this.props.onCloseDialog) this.props.onCloseDialog();
dis.dispatch({
action: 'forward_event',
event: this.props.mxEvent,
});
if (this.props.onCloseDialog) this.props.onCloseDialog();
this.closeMenu();
};