mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 17:29:55 -05:00
Fix: Toaster Dismissal (#27)
This commit is contained in:
@@ -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> = {
|
||||||
|
|||||||
Reference in New Issue
Block a user