mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-26 06:42:15 +03:00
Fixed #189
This commit is contained in:
parent
ce1301282d
commit
330786f459
@ -1,9 +1,10 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Platform } from 'react-native';
|
import { Platform, BackHandler } from 'react-native';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { addLocaleData } from 'react-intl';
|
import { addLocaleData } from 'react-intl';
|
||||||
import Config from 'react-native-config';
|
import Config from 'react-native-config';
|
||||||
import AppCenter from 'appcenter';
|
import AppCenter from 'appcenter';
|
||||||
|
import { NavigationActions } from 'react-navigation';
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
import en from 'react-intl/locale-data/en';
|
import en from 'react-intl/locale-data/en';
|
||||||
@ -54,6 +55,7 @@ class ApplicationContainer extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount = async () => {
|
componentDidMount = async () => {
|
||||||
|
BackHandler.addEventListener('hardwareBackPress', this._onBackPress);
|
||||||
await this._getUserData();
|
await this._getUserData();
|
||||||
this._getSettings();
|
this._getSettings();
|
||||||
};
|
};
|
||||||
@ -66,6 +68,17 @@ class ApplicationContainer extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
BackHandler.removeEventListener('hardwareBackPress', this.onBackPress);
|
||||||
|
}
|
||||||
|
|
||||||
|
_onBackPress = () => {
|
||||||
|
const { dispatch } = this.props;
|
||||||
|
|
||||||
|
dispatch(NavigationActions.back());
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
_getUserData = async () => {
|
_getUserData = async () => {
|
||||||
const { dispatch } = this.props;
|
const { dispatch } = this.props;
|
||||||
let realmData;
|
let realmData;
|
||||||
|
Loading…
Reference in New Issue
Block a user