mirror of https://github.com/vector-im/riot-web
Call onCloseDialog straigh away
This avoids some delay in the dialog disappearing Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
86dd81cda0
commit
f1c80fcede
|
@ -144,13 +144,13 @@ export default class MessageContextMenu extends React.Component {
|
||||||
|
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
try {
|
try {
|
||||||
|
if (this.props.onCloseDialog) this.props.onCloseDialog();
|
||||||
await cli.redactEvent(
|
await cli.redactEvent(
|
||||||
this.props.mxEvent.getRoomId(),
|
this.props.mxEvent.getRoomId(),
|
||||||
this.props.mxEvent.getId(),
|
this.props.mxEvent.getId(),
|
||||||
undefined,
|
undefined,
|
||||||
reason ? { reason } : {},
|
reason ? { reason } : {},
|
||||||
);
|
);
|
||||||
if (this.props.onCloseDialog) this.props.onCloseDialog();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const code = e.errcode || e.statusCode;
|
const code = e.errcode || e.statusCode;
|
||||||
// only show the dialog if failing for something other than a network error
|
// 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 = () => {
|
onForwardClick = () => {
|
||||||
|
if (this.props.onCloseDialog) this.props.onCloseDialog();
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'forward_event',
|
action: 'forward_event',
|
||||||
event: this.props.mxEvent,
|
event: this.props.mxEvent,
|
||||||
});
|
});
|
||||||
if (this.props.onCloseDialog) this.props.onCloseDialog();
|
|
||||||
this.closeMenu();
|
this.closeMenu();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue