From 874918767b5c2c031ec1e2021cc4f211a63c869b Mon Sep 17 00:00:00 2001 From: Nigel Breslaw Date: Wed, 14 Feb 2024 18:14:59 +0100 Subject: [PATCH] Add image fading and less useEffect (#369) --- native_gg/App.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/native_gg/App.tsx b/native_gg/App.tsx index 933fc782e..32ceab2c2 100644 --- a/native_gg/App.tsx +++ b/native_gg/App.tsx @@ -33,13 +33,12 @@ export default function App() { console.warn("No .ENV file found. Please create one."); } const authServiceRef = useRef(null); + authServiceRef.current = AuthService.getInstance(); + const [state, dispatch] = useReducer(reducer, initialState); + authServiceRef.current.subscribe(dispatch); useEffect(() => { - authServiceRef.current = AuthService.getInstance(); - // Subscribe to auth changes - authServiceRef.current.subscribe(dispatch); - // Unsubscribe when the component unmounts return () => { if (authServiceRef.current) { @@ -60,6 +59,7 @@ export default function App() {