fix auto log
continuous-integration/drone/push Build is passing Details

pull/12/head
David D'ALMEIDA 2 years ago
parent 8753904479
commit d1f1d57b2d

@ -26,22 +26,24 @@ export default function AuthNavigation() {
//@ts-ignore //@ts-ignore
await dispatch(getRefreshToken()) await dispatch(getRefreshToken())
await SplashScreen.hideAsync();
}
prepare();
}, [dispatch]);
const onStackRootView = useCallback(async () => {
if (appIsReady) { if (appIsReady) {
console.log("++++++++++++++++++++++++++++++++++++++jsiuis con +++++++++++++++++++++++++++++3");
await SplashScreen.hideAsync(); await SplashScreen.hideAsync();
} // await SplashScreen.hideAsync();
} }
prepare();
}, [appIsReady]); }, [appIsReady]);
// const onStackRootView = useCallback(async () => {
// }, [appIsReady]);
if (appIsReady == false) { if (appIsReady == false) {
console.log(appIsReady, "T9 AuthNav") console.log(appIsReady, "T9 AuthNav")
return null; return null;
} }
console.log(appIsReady, "k9 AuthNav") console.log(appIsReady, "k9 AuthNav")
// console.log(userToken, "k9 AuthNav") // console.log(userToken, "k9 AuthNav")
return ( return (
<> <>

@ -3,7 +3,7 @@ import { userTypes } from "../types/userTypes";
const initialState = { const initialState = {
loading: false, loading: false,
user: User, // for user object user: User, // for user object
userFladToken: null, // for storing the JWT userFladToken: "", // for storing the JWT
userSpotifyToken : null, userSpotifyToken : null,
error: null, error: null,
isLogedIn: false, isLogedIn: false,
@ -14,11 +14,13 @@ const initialState = {
// just for the navigation and speciafly use // just for the navigation and speciafly use
// and // and
case userTypes.RESTORE_TOKEN: case userTypes.RESTORE_TOKEN:
const resp = (action.playload == "" ? false : true)
console.log(resp, "si il ya le tokennen ou passssssssssss")
return { return {
...state, ...state,
userFladToken : action.playload, userFladToken : action.playload,
loading: true, loading: true,
// isLogedIn: true, isLogedIn: resp,
}; };
case userTypes.LOGIN: case userTypes.LOGIN:
console.log("++++++++++++++++++++++++++++++++++++++userRducer+++++++++++++++++++++++++++++3"); console.log("++++++++++++++++++++++++++++++++++++++userRducer+++++++++++++++++++++++++++++3");

@ -114,6 +114,7 @@ export const getRefreshToken = () => {
console.log("==========key2 =================="); console.log("==========key2 ==================");
console.log(userToken); console.log(userToken);
console.log("==========key =================="); console.log("==========key ==================");
console.log("==========on devrais être laaaa ==================");
dispatch(restoreToken(userToken) ); dispatch(restoreToken(userToken) );

Loading…
Cancel
Save