diff --git a/src/FLAD/navigation/AuthNavigation.tsx b/src/FLAD/navigation/AuthNavigation.tsx index daf8c95..6f171fc 100644 --- a/src/FLAD/navigation/AuthNavigation.tsx +++ b/src/FLAD/navigation/AuthNavigation.tsx @@ -23,25 +23,27 @@ export default function AuthNavigation() { useEffect(() => { async function prepare() { console.log(appIsReady, "1 AuthNav") - + //@ts-ignore await dispatch(getRefreshToken()) - await SplashScreen.hideAsync(); + if (appIsReady) { + console.log("++++++++++++++++++++++++++++++++++++++jsiuis con +++++++++++++++++++++++++++++3"); + await SplashScreen.hideAsync(); + } // await SplashScreen.hideAsync(); } prepare(); - }, [dispatch]); - - const onStackRootView = useCallback(async () => { - if (appIsReady) { - await SplashScreen.hideAsync(); - } }, [appIsReady]); + // const onStackRootView = useCallback(async () => { + + // }, [appIsReady]); + if (appIsReady == false) { console.log(appIsReady, "T9 AuthNav") return null; } console.log(appIsReady, "k9 AuthNav") + // console.log(userToken, "k9 AuthNav") return ( <> diff --git a/src/FLAD/redux/reducers/userReducer.tsx b/src/FLAD/redux/reducers/userReducer.tsx index 421f706..6dd6793 100644 --- a/src/FLAD/redux/reducers/userReducer.tsx +++ b/src/FLAD/redux/reducers/userReducer.tsx @@ -3,7 +3,7 @@ import { userTypes } from "../types/userTypes"; const initialState = { loading: false, user: User, // for user object - userFladToken: null, // for storing the JWT + userFladToken: "", // for storing the JWT userSpotifyToken : null, error: null, isLogedIn: false, @@ -14,11 +14,13 @@ const initialState = { // just for the navigation and speciafly use // and case userTypes.RESTORE_TOKEN: + const resp = (action.playload == "" ? false : true) + console.log(resp, "si il ya le tokennen ou passssssssssss") return { ...state, userFladToken : action.playload, loading: true, - // isLogedIn: true, + isLogedIn: resp, }; case userTypes.LOGIN: console.log("++++++++++++++++++++++++++++++++++++++userRducer+++++++++++++++++++++++++++++3"); diff --git a/src/FLAD/redux/thunk/authThunk.tsx b/src/FLAD/redux/thunk/authThunk.tsx index 631ad33..519aed5 100644 --- a/src/FLAD/redux/thunk/authThunk.tsx +++ b/src/FLAD/redux/thunk/authThunk.tsx @@ -114,6 +114,7 @@ export const getRefreshToken = () => { console.log("==========key2 =================="); console.log(userToken); console.log("==========key =================="); + console.log("==========on devrais ĂȘtre laaaa =================="); dispatch(restoreToken(userToken) );