Skip to content

Commit b61f275

Browse files
committed
fix(notifications): track exit animation timeout so pauseAll can cancel it
1 parent c5e8f7b commit b61f275

File tree

1 file changed

+14
-9
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/notifications

1 file changed

+14
-9
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/notifications/notifications.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,21 @@ export const Notifications = memo(function Notifications() {
184184
timers.set(
185185
n.id,
186186
setTimeout(() => {
187-
timers.delete(n.id)
188187
setExitingIds((prev) => new Set(prev).add(n.id))
189-
setTimeout(() => {
190-
removeNotification(n.id)
191-
setExitingIds((prev) => {
192-
const next = new Set(prev)
193-
next.delete(n.id)
194-
return next
195-
})
196-
}, EXIT_ANIMATION_MS)
188+
const exitKey = `${n.id}:exit`
189+
timers.delete(n.id)
190+
timers.set(
191+
exitKey,
192+
setTimeout(() => {
193+
timers.delete(exitKey)
194+
removeNotification(n.id)
195+
setExitingIds((prev) => {
196+
const next = new Set(prev)
197+
next.delete(n.id)
198+
return next
199+
})
200+
}, EXIT_ANIMATION_MS)
201+
)
197202
}, AUTO_DISMISS_MS)
198203
)
199204
}

0 commit comments

Comments
 (0)