fix nopost fetching issue

This commit is contained in:
feruz 2020-01-12 06:08:53 +02:00
parent 16576aa25d
commit 0461da96d0
3 changed files with 10 additions and 1 deletions

View File

@ -113,7 +113,7 @@ const CommentsView = ({
<ActionSheet <ActionSheet
ref={commentMenu} ref={commentMenu}
options={menuItems} options={menuItems}
title={get(selectedComment, 'author')} title={get(selectedComment, 'summary')}
cancelButtonIndex={isOwnProfile ? 2 : 1} cancelButtonIndex={isOwnProfile ? 2 : 1}
onPress={index => handleOnPressCommentMenu(index, selectedComment)} onPress={index => handleOnPressCommentMenu(index, selectedComment)}
/> />

View File

@ -246,10 +246,13 @@ const PostsView = ({
} }
} else if (result.length === 0) { } else if (result.length === 0) {
setIsNoPost(true); setIsNoPost(true);
setRefreshing(false);
setIsLoading(false);
} }
}) })
.catch(() => { .catch(() => {
setRefreshing(false); setRefreshing(false);
setIsLoading(false);
}); });
}, },
[ [

View File

@ -138,6 +138,7 @@ class ApplicationContainer extends Component {
if (!isIos) BackHandler.removeEventListener('hardwareBackPress', this._onBackPress); if (!isIos) BackHandler.removeEventListener('hardwareBackPress', this._onBackPress);
// NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange); // NetInfo.isConnected.removeEventListener('connectionChange', this._handleConntectionChange);
//clearInterval(this.globalInterval);
Linking.removeEventListener('url', this._handleOpenURL); Linking.removeEventListener('url', this._handleOpenURL);
@ -156,6 +157,9 @@ class ApplicationContainer extends Component {
if (state.isConnected !== isConnected) { if (state.isConnected !== isConnected) {
dispatch(setConnectivityStatus(state.isConnected)); dispatch(setConnectivityStatus(state.isConnected));
this._fetchApp(); this._fetchApp();
/*if (!state.isConnected) {
clearInterval(this.globalInterval);
}*/
} }
}); });
}; };
@ -253,6 +257,7 @@ class ApplicationContainer extends Component {
const { isConnected } = this.props; const { isConnected } = this.props;
if (isConnected && userRealmObject) { if (isConnected && userRealmObject) {
await this._fetchUserDataFromDsteem(userRealmObject); await this._fetchUserDataFromDsteem(userRealmObject);
//this.globalInterval = setInterval(this._refreshGlobalProps, 180000);
} }
}; };
@ -615,6 +620,7 @@ class ApplicationContainer extends Component {
if (isConnected !== null && isConnected !== nextProps.isConnected && nextProps.isConnected) { if (isConnected !== null && isConnected !== nextProps.isConnected && nextProps.isConnected) {
this._fetchApp(); this._fetchApp();
//this.globalInterval = setInterval(this._refreshGlobalProps, 180000);
} }
} }