Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-05-27 11:48:48 +01:00
parent 254ed4b1b6
commit 3dade4e759
1 changed files with 4 additions and 2 deletions

View File

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