Fix: Toaster Dismissal (#27)

This commit is contained in:
Youwes09
2026-04-13 10:59:03 -05:00
parent 5a2f88b806
commit 6c11a9d53e
+4 -1
View File
@@ -33,8 +33,11 @@
} }
$effect(() => { $effect(() => {
const activeIds = new Set(store.toasts.map(t => t.id));
store.toasts.forEach(schedule); store.toasts.forEach(schedule);
return () => timers.forEach(clearTimeout); for (const [id, timer] of timers) {
if (!activeIds.has(id)) { clearTimeout(timer); timers.delete(id); }
}
}); });
const icons: Record<Toast["kind"], string> = { const icons: Record<Toast["kind"], string> = {