-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstart.js
More file actions
58 lines (41 loc) · 1.27 KB
/
start.js
File metadata and controls
58 lines (41 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React, {useEffect} from 'react'
import {View, StyleSheet, ActivityIndicator} from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
const StartScreen = (props) =>{
useEffect(() =>{
tryLogin = async () =>{
const userData = await AsyncStorage.getItem('userData')
if(!userData){
props.navigation.navigate('Auth')
return
}
const transformedData = JSON.parse(userData)
const { token, userId, expiryDate,emailId} = transformedData
const expirationDate = new Date(expiryDate)
//if(expirationDate<=new Date() || !token || !userId){
// props.navigation.navigate('Auth')
// return
//}
const emailInfo={
id:emailId
}
console.log("000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
console.log(emailInfo.id);
props.navigation.navigate('Home',{data:emailId});
}
tryLogin()
})
return(
<View style = {styles.screen}>
<ActivityIndicator size = 'large' />
</View>
)
};
const styles = StyleSheet.create({
screen:{
flex:1,
justifyContent:'center',
alignItems:'center'
}
})
export default StartScreen