- Initialize @sentry/react-native with dedicated mobile project DSN - Wrap root layout with Sentry.wrap() for unhandled error capture - Configure Sentry plugin with org (trails-qq) and project (mobile) for source map uploads during EAS builds - Disabled in dev, full tracing in production Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
680 B
TypeScript
28 lines
680 B
TypeScript
import { useEffect, useState } from "react";
|
|
import { Stack, router } from "expo-router";
|
|
import { Sentry, initSentry } from "../lib/sentry";
|
|
import { isAuthenticated } from "../lib/auth";
|
|
import { startVersionCheck } from "../lib/version-check";
|
|
|
|
initSentry();
|
|
|
|
function RootLayout() {
|
|
const [checked, setChecked] = useState(false);
|
|
|
|
useEffect(() => {
|
|
isAuthenticated().then((authed) => {
|
|
if (!authed) {
|
|
router.replace("/login");
|
|
} else {
|
|
startVersionCheck();
|
|
}
|
|
setChecked(true);
|
|
});
|
|
}, []);
|
|
|
|
if (!checked) return null;
|
|
|
|
return <Stack screenOptions={{ headerShown: false }} />;
|
|
}
|
|
|
|
export default Sentry.wrap(RootLayout);
|