Skip to content

Commit 46d5e94

Browse files
committed
neat
1 parent 5b6c9ad commit 46d5e94

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/App.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@ const AppContent: React.FC = () => {
1414
useEffect(() => {
1515
const handleHashChange = () => {
1616
const hash = window.location.hash.slice(1);
17-
if (hash === 'auth') {
17+
// Extract just the route part before any query parameters
18+
const route = hash.split('?')[0];
19+
20+
if (route === 'auth') {
1821
setCurrentPage('auth');
19-
} else if (hash === 'account') {
22+
} else if (route === 'account') {
2023
setCurrentPage('account');
21-
} else if (hash === 'terms') {
24+
} else if (route === 'terms') {
2225
setCurrentPage('terms');
23-
} else if (hash === 'privacy') {
26+
} else if (route === 'privacy') {
2427
setCurrentPage('privacy');
25-
} else if (hash === 'learn-more') {
28+
} else if (route === 'learn-more') {
2629
setCurrentPage('learn-more');
27-
} else if (hash === 'pricing') {
30+
} else if (route === 'pricing') {
2831
setCurrentPage('pricing');
29-
} else if (hash === 'welcome') {
32+
} else if (route === 'welcome') {
3033
setCurrentPage('welcome');
3134
} else {
3235
setCurrentPage('welcome');

src/pages/Auth/Auth.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Auth: React.FC = () => {
2626
const {login, loginWithApple} = useAuth();
2727
const [isGenerating, setIsGenerating] = useState(false);
2828
const [isRedirecting, setIsRedirecting] = useState(false);
29-
const [firebaseUser, setFirebaseUser] = useState<FirebaseUser | null>(null);
29+
// Remove unused firebaseUser state since we handle auth state directly in useEffect
3030
const [checkingAuth, setCheckingAuth] = useState(true);
3131

3232
// Get redirect URL from URL params (for CLI integration)
@@ -38,7 +38,6 @@ const Auth: React.FC = () => {
3838
// Check Firebase auth state on mount
3939
useEffect(() => {
4040
const unsubscribe = auth.onAuthStateChanged((user) => {
41-
setFirebaseUser(user);
4241
setCheckingAuth(false);
4342

4443
// If user is signed in and we have a callback URL, generate token and redirect

0 commit comments

Comments
 (0)