This commit is contained in:
Mustafa Buyukcelebi 2019-05-10 15:09:04 +03:00
parent 1d136aa7d2
commit ed8e47bdd7
2 changed files with 8 additions and 8 deletions

View File

@ -136,6 +136,7 @@ class ApplicationContainer extends Component {
await this._refreshGlobalProps();
this._getSettings();
await this._getUserData();
this.setState({ isReady: true });
};
_handleConntectionChange = (status) => {
@ -264,8 +265,6 @@ class ApplicationContainer extends Component {
if (response.nsfw !== '') dispatch(setNsfw(response.nsfw));
dispatch(setCurrency(response.currency !== '' ? response.currency : 'usd'));
this.setState({ isReady: true });
}
});
};
@ -331,12 +330,13 @@ class ApplicationContainer extends Component {
// || navigator.userLanguage
// || selectedLanguage;
if (isRenderRequire && isReady) {
if (isRenderRequire) {
return (
<ApplicationScreen
isConnected={isConnected}
locale={selectedLanguage}
toastNotification={toastNotification}
isReady={isReady}
{...this.props}
/>
);

View File

@ -1,6 +1,6 @@
import React, { Component, Fragment } from 'react';
import React, { Component } from 'react';
import { IntlProvider } from 'react-intl';
import { StatusBar, Platform } from 'react-native';
import { StatusBar, Platform, View } from 'react-native';
import EStyleSheet from 'react-native-extended-stylesheet';
import { ReduxNavigation } from '../../../navigation/reduxNavigation';
import { flattenMessages } from '../../../utils/flattenMessages';
@ -43,14 +43,14 @@ class ApplicationScreen extends Component {
render() {
const {
isConnected, isDarkTheme, locale, toastNotification,
isConnected, isDarkTheme, locale, toastNotification, isReady,
} = this.props;
const { isShowToastNotification } = this.state;
const barStyle = isDarkTheme ? 'light-content' : 'dark-content';
const barColor = isDarkTheme ? '#1e2835' : '#fff';
return (
<Fragment>
<View pointerEvents={isReady ? 'auto' : 'none'} style={{ flex: 1 }}>
{Platform.os === 'ios' ? (
<StatusBar barStyle={barStyle} />
) : (
@ -74,7 +74,7 @@ class ApplicationScreen extends Component {
onHide={this._handleOnHideToastNotification}
/>
)}
</Fragment>
</View>
);
}
}