... and take action when the counter reaches zero in verification toast

This commit is contained in:
Zoe 2020-01-30 15:37:44 +00:00
parent 7e98ea79d2
commit 49d2ed8906

View File

@ -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);