check .started first as it can be both .started and pending

This commit is contained in:
Bruno Windels 2020-03-06 17:20:08 +01:00
parent a7de575316
commit f8ef5bb6a5

View File

@ -1503,7 +1503,12 @@ export default createReactClass({
return;
}
if (request.pending) {
if (request.started) {
const VerificationRequestDialog = sdk.getComponent("views.dialogs.VerificationRequestDialog");
Modal.createTrackedDialog('Incoming Verification', '', VerificationRequestDialog, {
verificationRequest: request,
}, null, /* priority = */ false, /* static = */ true);
} else if (request.pending) {
ToastStore.sharedInstance().addOrReplaceToast({
key: 'verifreq_' + request.channel.transactionId,
title: _t("Verification Request"),
@ -1511,11 +1516,6 @@ export default createReactClass({
props: {request},
component: sdk.getComponent("toasts.VerificationRequestToast"),
});
} else if (request.started) {
const VerificationRequestDialog = sdk.getComponent("views.dialogs.VerificationRequestDialog");
Modal.createTrackedDialog('Incoming Verification', '', VerificationRequestDialog, {
verificationRequest: request,
}, null, /* priority = */ false, /* static = */ true);
}
});
// Fire the tinter right on startup to ensure the default theme is applied