fix startup issue android back button

This commit is contained in:
feruz 2020-01-29 04:33:00 +02:00
parent 162808b498
commit d083384240

View File

@ -82,7 +82,7 @@ export const setPreviousAppState = () => {
const appStateTimeout = setTimeout(() => { const appStateTimeout = setTimeout(() => {
previousAppState = AppState.currentState; previousAppState = AppState.currentState;
clearTimeout(appStateTimeout); clearTimeout(appStateTimeout);
}, 2000); }, 500);
}; };
class ApplicationContainer extends Component { class ApplicationContainer extends Component {
@ -138,7 +138,6 @@ 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,11 +155,9 @@ class ApplicationContainer extends Component {
const { isConnected, dispatch } = this.props; const { isConnected, dispatch } = this.props;
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);
}*/
} }
this._fetchApp();
}); });
}; };
@ -217,7 +214,6 @@ class ApplicationContainer extends Component {
_handleAppStateChange = nextAppState => { _handleAppStateChange = nextAppState => {
const { appState } = this.state; const { appState } = this.state;
const { isPinCodeOpen: _isPinCodeOpen } = this.props; const { isPinCodeOpen: _isPinCodeOpen } = this.props;
getExistUser().then(isExistUser => { getExistUser().then(isExistUser => {
if (isExistUser) { if (isExistUser) {
if (appState.match(/active|forground/) && nextAppState === 'inactive') { if (appState.match(/active|forground/) && nextAppState === 'inactive') {
@ -257,7 +253,6 @@ 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);
} }
}; };
@ -617,7 +612,6 @@ 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);
} }
} }