Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix: Notification transitions are now properly applied on close
- `close` now sets the notification's `open` prop to `false` before
removing it from the queue.
  • Loading branch information
dchae committed May 18, 2025
commit bd3718e179ad75c3cf9ed29b58b9d1e42dd0f27c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,15 @@ function NotificationsProvider(props: NotificationsProviderProps) {
const close = React.useCallback<CloseNotification>((key) => {
setState((prev) => ({
...prev,
queue: prev.queue.filter((n) => n.notificationKey !== key),
queue: prev.queue.map((n) => (n.notificationKey === key ? { ...n, open: false } : n)),
}));

setTimeout(() => {
setState((prev) => ({
...prev,
queue: prev.queue.filter((n) => n.open),
}));
}, 100);
}, []);

const contextValue = React.useMemo(() => ({ show, close }), [show, close]);
Expand Down