diff --git a/src/stores/ToastStore.ts b/src/stores/ToastStore.ts index 55c48c3937..3fa2f4b11f 100644 --- a/src/stores/ToastStore.ts +++ b/src/stores/ToastStore.ts @@ -68,6 +68,11 @@ export default class ToastStore extends EventEmitter { } 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) { this.countSeen++; }