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