Merge pull request #3943 from matrix-org/dbkr/kill_lingering_verification_toast

Stop rogue verification toast if you verify during login
This commit is contained in:
David Baker 2020-01-27 11:17:55 +00:00 committed by GitHub
commit 1ab91d1d74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View file

@ -23,9 +23,11 @@ export default class ToastContainer extends React.Component {
constructor() {
super();
this.state = {toasts: ToastStore.sharedInstance().getToasts()};
}
componentDidMount() {
// Start listening here rather than in componentDidMount because
// toasts may dismiss themselves in their didMount if they find
// they're already irrelevant by the time they're mounted, and
// our own componentDidMount is too late.
ToastStore.sharedInstance().on('update', this._onToastStoreUpdate);
}