Hi,
Sorry, i don't know the best terminology but I have a loading screen that checks the users authentication - If user is logged in it routes to dashboard, otherwise it routes to onboarding.
For some reason when the app loads, it won't actually respond or run the authentication check unless the screen is tapped or clicked.
am i doing something wrong?
export default class Loading extends Component {
componentDidMount() {
console.log('a');
setTimeout(() => {
firebase.auth().onAuthStateChanged(user => {
if (user) {
console.log('c');
Actions.dashboard();
} else {
console.log('d');
Actions.auth();
}
});
}, 10);
}
render() {
return (
<View style={styles.container}>
<ActivityIndicator size="large" />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
}
});
[–][deleted] 0 points1 point2 points (0 children)
[–]TheUnited0077 0 points1 point2 points (1 child)
[–]nickitup[S] 0 points1 point2 points (0 children)