Skip to content

Commit

Permalink
[core] refactor: Use isTimeoutEnabled constant in other parts of `<…
Browse files Browse the repository at this point in the history
…Toast2>` (#6785)
  • Loading branch information
gluxon authored May 13, 2024
1 parent e094518 commit 906f5d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/components/toast/toast2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ export const Toast2 = React.forwardRef<HTMLDivElement, ToastProps>((props, ref)

// start timeout on mount or change, cancel on unmount
React.useEffect(() => {
if (timeout != null && timeout > 0) {
if (isTimeoutEnabled) {
startTimeout();
} else {
clearTimeout();
}
return clearTimeout;
}, [clearTimeout, startTimeout, timeout]);
}, [clearTimeout, startTimeout, isTimeoutEnabled, timeout]);

const triggerDismiss = React.useCallback(
(didTimeoutExpire: boolean) => {
Expand Down

1 comment on commit 906f5d0

@svc-palantir-github
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[core] refactor: Use `isTimeoutEnabled` constant in other parts of `` (#6785)

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

Please sign in to comment.