diff --git a/apps/mobile/src/App.tsx b/apps/mobile/src/App.tsx index b0a27fe23..5e3aaab99 100644 --- a/apps/mobile/src/App.tsx +++ b/apps/mobile/src/App.tsx @@ -42,7 +42,7 @@ initPlausible({ platformType: 'mobile' }); changeTwTheme('dark'); function AppNavigation() { - const { library } = useClientContext(); + const { libraries, library } = useClientContext(); // TODO: Make sure library has actually been loaded by this point - precache with useCachedLibraries? // if (library === undefined) throw new Error("Tried to render AppNavigation before libraries fetched!") @@ -54,6 +54,10 @@ function AppNavigation() { usePlausiblePageViewMonitor({ currentPath }); + if (library === null && libraries.data) { + currentLibraryStore.id = libraries.data[0]?.uuid ?? null; + } + return (