- Migrate all navigation calls from magic strings to centralized href helpers - Extract inline device registration logic into useRegisterPushDevice hook - Remove unused terms and privacy policy routes from profile stack - Add hrefTradeDetail helper for trade detail navigation - Restore routePayloadCache.stashSystemMessage for group request/invite handling - Change desktop shell tab navigation from replace to push
25 lines
717 B
TypeScript
25 lines
717 B
TypeScript
import { useEffect } from 'react';
|
|
import { Redirect } from 'expo-router';
|
|
|
|
import { AppRouteStack } from '../../src/app-navigation/AppRouteStack';
|
|
import { messageManager, useAuthStore } from '../../src/stores';
|
|
import { useRegisterPushDevice } from '../../src/hooks';
|
|
import { hrefAuthLogin } from '../../src/navigation/hrefs';
|
|
|
|
export default function AppLayout() {
|
|
const isAuthenticated = useAuthStore((s) => s.isAuthenticated);
|
|
const userID = useAuthStore((s) => s.currentUser?.id);
|
|
|
|
useEffect(() => {
|
|
messageManager.initialize();
|
|
}, []);
|
|
|
|
useRegisterPushDevice(isAuthenticated, userID);
|
|
|
|
if (!isAuthenticated) {
|
|
return <Redirect href={hrefAuthLogin()} />;
|
|
}
|
|
|
|
return <AppRouteStack />;
|
|
}
|