Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
icon: './assets/icon.png',
userInterfaceStyle: 'automatic',
newArchEnabled: true,
splash: {
image: './assets/adaptive-icon.png',
resizeMode: 'contain',
backgroundColor: '#2484c4',
},
updates: {
fallbackToCacheTimeout: 0,
},
Expand Down
43 changes: 0 additions & 43 deletions src/app/(app)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,6 @@ export default function TabLayout() {
const lastSignedInStatus = useRef<string | null>(null);
const parentRef = useRef(null);

const hideSplash = useCallback(async () => {
if (hasHiddenSplash.current) return;

try {
await SplashScreen.hideAsync();
hasHiddenSplash.current = true;
logger.info({
message: 'Splash screen hidden',
context: { status },
});
} catch (error) {
logger.error({
message: 'Failed to hide splash screen',
context: { error, status },
});
}
}, [status]);

// Initialize push notifications
usePushNotifications();

Expand Down Expand Up @@ -164,31 +146,6 @@ export default function TabLayout() {
hasInitialized: hasInitialized.current,
});

// Handle splash screen hiding - only hide when auth status is settled
useEffect(() => {
logger.info({
message: 'Splash screen effect triggered',
context: { status, hasHiddenSplash: hasHiddenSplash.current },
});

// Only hide splash when status is settled (not 'idle' or 'loading')
if (status === 'signedIn' || status === 'signedOut' || status === 'onboarding') {
logger.info({
message: 'Auth status settled, hiding splash screen',
context: { status },
});

// Add debounce to smooth rendering on slow devices
const splashTimeout = setTimeout(() => {
hideSplash();
}, 200); // 200ms debounce for optimal performance

return () => {
clearTimeout(splashTimeout);
};
}
}, [status, hideSplash]);

// Handle app initialization - simplified logic
useEffect(() => {
const shouldInitialize = status === 'signedIn' && !hasInitialized.current && !isInitializing.current && lastSignedInStatus.current !== 'signedIn';
Expand Down
2 changes: 1 addition & 1 deletion src/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { uuidv4 } from '@/lib/utils';
import { appInitializationService } from '@/services/app-initialization.service';

// Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync();
//SplashScreen.preventAutoHideAsync();

export { ErrorBoundary } from 'expo-router';
export const navigationRef = createNavigationContainerRef();
Expand Down