mirror of https://github.com/vector-im/riot-web
Add a warning for dismissing invalid toasts
parent
c667ea69af
commit
3674b6446e
|
@ -68,6 +68,11 @@ export default class ToastStore extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
dismissToast(key) {
|
dismissToast(key) {
|
||||||
|
if (!this.toasts.some(t => t.key === key)) {
|
||||||
|
console.warn(`No toast for ${key} found - cannot dismiss. Check your toastKey`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.toasts[0] && this.toasts[0].key === key) {
|
if (this.toasts[0] && this.toasts[0].key === key) {
|
||||||
this.countSeen++;
|
this.countSeen++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue