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

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

@ -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 (
<>

@ -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");

@ -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) );

Loading…
Cancel
Save