Skip to content

Commit

Permalink
🪟 🐛 trigger nav only if we have state to remove (#12158)
Browse files Browse the repository at this point in the history
  • Loading branch information
chandlerprall committed Apr 17, 2024
1 parent fb5604d commit 0a7f701
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ export const InputContainer: React.FC<React.PropsWithChildren<{ highlightAfterRe
let highlightTimeout: number;

if (highlightAfterRedirect && locationState?.action === "scheduleType") {
// remove the redirection info from the location state
navigate(pathname, { replace: true });

setHighlighted(true);
highlightTimeout = window.setTimeout(() => {
setHighlighted(false);
}, 1500);
}
// remove the redirection info from the location state
navigate(pathname, { replace: true });

return () => {
window.clearTimeout(highlightTimeout);
Expand Down

0 comments on commit 0a7f701

Please sign in to comment.