Merge pull request #4624 from matrix-org/t3chguy/toasts3_2

Migrate Banners to Toasts
This commit is contained in:
Michael Telatynski 2020-05-28 18:21:28 +01:00 committed by GitHub
commit 0242b6f3f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 506 additions and 626 deletions

View file

@ -68,13 +68,15 @@ export default class ToastStore extends EventEmitter {
}
dismissToast(key) {
if (this.toasts[0] && this.toasts[0].key === key) {
this.countSeen++;
}
const length = this.toasts.length;
this.toasts = this.toasts.filter(t => t.key !== key);
if (length !== this.toasts.length) {
if (this.toasts.length === 0) {
this.countSeen = 0;
} else {
this.countSeen++;
}
this.emit('update');