From 49d2ed890683e1a3782a0212b85501041dce96ba Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 30 Jan 2020 15:37:44 +0000 Subject: [PATCH] ... and take action when the counter reaches zero in verification toast --- src/components/views/toasts/VerificationRequestToast.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/views/toasts/VerificationRequestToast.js b/src/components/views/toasts/VerificationRequestToast.js index fce239f655..4f2c85acf6 100644 --- a/src/components/views/toasts/VerificationRequestToast.js +++ b/src/components/views/toasts/VerificationRequestToast.js @@ -38,6 +38,11 @@ export default class VerificationRequestToast extends React.PureComponent { let {counter} = this.state; counter = Math.max(0, counter - 1); this.setState({counter}); + + if (counter == 0) { + clearInterval(this._intervalHandle); + this.cancel(); + } }, 1000); } request.on("change", this._checkRequestIsPending);