Skip to content

Commit 27b3671

Browse files
committed
v2.46 - Fix Glitch
1 parent 17b3538 commit 27b3671

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

frontend/src/components/app/AppShell.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ function AuthGate({ children }: { children: React.ReactNode }) {
6767
</div>
6868
)
6969

70-
if (user) return <>{children}</>
71-
// Keep existing shell visible during transient auth loading (prevents sidebar flicker/disappear).
72-
if (loading) return <>{children}</>
73-
// Not authenticated, redirecting away from dashboard.
74-
if (!user) return renderGateStatus("Redirecting to sign-in...")
75-
return <>{children}</>
70+
// Always render the shell (sidebar, main, topbar, input) so it stays in the DOM and cached —
71+
// no unmount on auth loading, so no black flash or sidebar disappearing when switching pages.
72+
// Only overlay the redirect message when we're sure the user is not authenticated.
73+
return (
74+
<>
75+
{children}
76+
{!loading && !user ? renderGateStatus("Redirecting to sign-in...") : null}
77+
</>
78+
)
7679
}
7780

7881
function ShellInner({ children }: { children: React.ReactNode }) {

0 commit comments

Comments
 (0)