From e51ccb46b8673b7444b7cac0792da4a9f6a91c4b Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 4 Apr 2024 02:51:10 +0100 Subject: Scope query client per DID (#3333) * Move QueryProvider inside the key * Pull useQueryClient-dependent code down in App.native * Remove useQueryClient dependency from session provider * Scope query client per DID --- src/App.native.tsx | 94 +++++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 44 deletions(-) (limited to 'src/App.native.tsx') diff --git a/src/App.native.tsx b/src/App.native.tsx index 57ebe4951..9abe4a559 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -54,12 +54,10 @@ SplashScreen.preventAutoHideAsync() function InnerApp() { const {isInitialLoad, currentAccount} = useSession() const {resumeSession} = useSessionApi() - const queryClient = useQueryClient() const theme = useColorModeTheme() const {_} = useLingui() useIntentHandler() - useNotificationsListener(queryClient) useOTAUpdates() // init @@ -79,25 +77,29 @@ function InnerApp() { - - - - - - - {/* All components should be within this provider */} - - - - - - - - - - - - + + + + + + + + + {/* All components should be within this provider */} + + + + + + + + + + + + + + @@ -105,6 +107,12 @@ function InnerApp() { ) } +function PushNotificationsListener({children}: {children: React.ReactNode}) { + const queryClient = useQueryClient() + useNotificationsListener(queryClient) + return children +} + function App() { const [isReady, setReady] = useState(false) @@ -121,29 +129,27 @@ function App() { * that is set up in the InnerApp component above. */ return ( - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + ) } -- cgit 1.4.1