ref(rr6): Convert RedirectToProjectModal to hooks#110744
ref(rr6): Convert RedirectToProjectModal to hooks#110744evanpurkhiser merged 1 commit intomasterfrom
Conversation
Replace class component + withSentryRouter with function component using useRoutes, useParams, and useLocation hooks directly. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Timer briefly shows "0 seconds" before redirecting
- Changed redirect condition from timer <= 0 to timer <= 1 to prevent rendering with 0 seconds visible before redirect.
Or push these changes by commenting:
@cursor push 24417391d5
Preview (24417391d5)
diff --git a/static/app/components/modals/redirectToProject.tsx b/static/app/components/modals/redirectToProject.tsx
--- a/static/app/components/modals/redirectToProject.tsx
+++ b/static/app/components/modals/redirectToProject.tsx
@@ -36,7 +36,7 @@
}, []);
useEffect(() => {
- if (timer <= 0) {
+ if (timer <= 1) {
testableWindowLocation.assign(newPath);
}
}, [timer, newPath]);This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| if (timer <= 0) { | ||
| testableWindowLocation.assign(newPath); | ||
| } | ||
| }, [timer, newPath]); |
There was a problem hiding this comment.
Timer briefly shows "0 seconds" before redirecting
Low Severity
The redirect condition changed from timer <= 1 (old code) to timer <= 0, and the decrement is now unconditional. The old code redirected synchronously inside the interval callback when timer was still 1, so the user never saw "0 seconds." The new code decrements to 0, renders with timer=0 visible in the countdown text ("in 0 seconds…"), and only then fires the redirect via useEffect. This is a subtle behavioral regression for a refactor intended to preserve existing behavior.



Replace class component + withSentryRouter with function component
using useRoutes, useParams, and useLocation hooks directly.
Co-Authored-By: Claude noreply@anthropic.com