feat(mobile): mount CallProvider + global IncomingCallModal

This commit is contained in:
byGalax
2026-05-14 06:12:20 +02:00
parent 098e4f4c1d
commit b81c63a2d3
+11 -10
View File
@@ -5,13 +5,11 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { SafeAreaProvider } from 'react-native-safe-area-context'; import { SafeAreaProvider } from 'react-native-safe-area-context';
import { ErrorBoundary } from '../components/ErrorBoundary'; import { ErrorBoundary } from '../components/ErrorBoundary';
import { IncomingCallModal } from '../components/IncomingCallModal';
import { AuthProvider } from '../lib/authContext'; import { AuthProvider } from '../lib/authContext';
import { CallProvider } from '../lib/callContext';
import { createLibsodiumBackend } from '../lib/cryptoBackend'; import { createLibsodiumBackend } from '../lib/cryptoBackend';
// Register the crypto backend exactly once, before any code that calls
// crypto.getCryptoBackend(). Doing it at module load (not inside the
// component) avoids a race where a child component renders before the
// effect fires.
crypto.setCryptoBackend(createLibsodiumBackend()); crypto.setCryptoBackend(createLibsodiumBackend());
export default function RootLayout() { export default function RootLayout() {
@@ -20,12 +18,15 @@ export default function RootLayout() {
<SafeAreaProvider> <SafeAreaProvider>
<ErrorBoundary> <ErrorBoundary>
<AuthProvider> <AuthProvider>
<StatusBar style="auto" /> <CallProvider>
<Stack screenOptions={{ headerShown: false }}> <StatusBar style="auto" />
<Stack.Screen name="index" /> <Stack screenOptions={{ headerShown: false }}>
<Stack.Screen name="(app)" /> <Stack.Screen name="index" />
<Stack.Screen name="auth/callback" /> <Stack.Screen name="(app)" />
</Stack> <Stack.Screen name="auth/callback" />
</Stack>
<IncomingCallModal />
</CallProvider>
</AuthProvider> </AuthProvider>
</ErrorBoundary> </ErrorBoundary>
</SafeAreaProvider> </SafeAreaProvider>