Merge pull request #4624 from matrix-org/t3chguy/toasts3_2
Migrate Banners to Toasts
This commit is contained in:
commit
0242b6f3f3
23 changed files with 506 additions and 626 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue