Updating useeffect
This commit is contained in:
@@ -5,11 +5,17 @@ import API from './../API.js';
|
||||
import LoginForm from './../components/Login.js';
|
||||
|
||||
export default function App({navigation, route}) {
|
||||
useEffect(async () => {
|
||||
let r = await API.isLoggedIn();
|
||||
if(r){
|
||||
await API.logout();
|
||||
navigation.navigate('Login')
|
||||
useEffect(()=>{
|
||||
getData = async () => {
|
||||
let r = await API.isLoggedIn();
|
||||
if(r){
|
||||
await API.logout();
|
||||
navigation.navigate('Login')
|
||||
}
|
||||
}
|
||||
getData();
|
||||
return ()=>{
|
||||
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ const getProfilePosts = async (profileid) => {
|
||||
try {
|
||||
const value = await AsyncStorage.getItem('profile_' + profileid)
|
||||
if (value !== null) {
|
||||
console.log(JSON.parse(value))
|
||||
return JSON.parse(value);
|
||||
}
|
||||
return [];
|
||||
@@ -61,7 +60,7 @@ let Profile = ({ navigation, route }) => {
|
||||
return ()=>{
|
||||
subscribed = false;
|
||||
}
|
||||
}, [route.params]);
|
||||
}, [route.params?.profileid]);
|
||||
const renderPost = (({ item }) => {
|
||||
if (item.nonOrganicType)
|
||||
return (<></>);
|
||||
|
||||
Reference in New Issue
Block a user