Skip to content

Commit

Permalink
fix: ensure toast exists before setting value #1150 #1170
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed Nov 27, 2024
1 parent 8065934 commit 1274c8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/containerObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ export function createContainerObserver(
props = p;
},
setToggle: (id: Id, fn: (v: boolean) => void) => {
toasts.get(id)!.toggle = fn;
const t = toasts.get(id);
if (t) t.toggle = fn;
},
isToastActive: (id: Id) => activeToasts.some(v => v === id),
getSnapshot: () => snapshot
Expand Down

0 comments on commit 1274c8d

Please sign in to comment.