Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workaround for user login breaking app routing in certain cases #1718

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
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
8 changes: 7 additions & 1 deletion src/routes/TabbedRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ function InnerTabbedRoutes({
if (pathnameSections <= 1) return;

function push() {
router.push(`/${tabRef?.current || "posts"}`, "none", "push");
// TODO requestAnimationFrame workaround added for regression caused in react 19 upgrades,
// broke right after eda26916b56ca0593f4711516a3ef3048f75fbb6. needs investigation
// repro: be completely logged out. restart app. login. go to a post, go back,
// repeat navigations, see issue
requestAnimationFrame(() => {
router.push(`/${tabRef?.current || "posts"}`, "none", "push");
});
}

// have to wait for the ActorRedirect to do its thing, so it doesn't get clobbered
Expand Down