|
|
@@ -11,6 +11,7 @@ import Overview from './Overview';
|
|
|
import { MyRefreshProps } from '../../components/ThemesConfig';
|
|
|
import { ElevationObject } from '../../components/Button';
|
|
|
import TextView from '../../components/TextView';
|
|
|
+import Dialog from '../../components/Dialog';
|
|
|
|
|
|
export default class Wallet extends Component {
|
|
|
constructor(props) {
|
|
|
@@ -22,30 +23,39 @@ export default class Wallet extends Component {
|
|
|
tabWidth: 0,
|
|
|
tabHeight: 0,
|
|
|
balanceText: '',
|
|
|
- pageShown: false
|
|
|
+ pageShown: true
|
|
|
};
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
this.props.navigation.addListener('focus', () => {
|
|
|
this.onRefresh();
|
|
|
+ this.setState({
|
|
|
+ pageShown: true
|
|
|
+ })
|
|
|
getUserInfo(info => {
|
|
|
this.setState({
|
|
|
balance: info.credit,
|
|
|
- balanceText: info.creditStr,
|
|
|
- pageShown: true
|
|
|
+ balanceText: info.creditStr
|
|
|
})
|
|
|
}, true)
|
|
|
});
|
|
|
+ this.props.navigation.addListener('blur', () => {
|
|
|
+ this.setState({
|
|
|
+ pageShown: false
|
|
|
+ })
|
|
|
+ });
|
|
|
this.props.navigation.addListener('beforeRemove', (e) => {
|
|
|
if (this.state.pageShown) {
|
|
|
e.preventDefault();
|
|
|
+ Dialog.showProgressDialog();
|
|
|
this.setState({
|
|
|
pageShown: false
|
|
|
}, () => {
|
|
|
setTimeout(() => {
|
|
|
+ Dialog.dismissLoading();
|
|
|
goBack();
|
|
|
- }, 100);
|
|
|
+ }, 500);
|
|
|
});
|
|
|
}
|
|
|
});
|