Fixed theme issue

This commit is contained in:
Mustafa Buyukcelebi 2019-05-10 16:58:16 +03:00
parent ed8e47bdd7
commit 8aefa43e31

View File

@ -38,7 +38,6 @@ import {
setAuthStatus, setAuthStatus,
removeSCAccount, removeSCAccount,
setExistUser, setExistUser,
setDefaultFooter,
} from '../../../realm/realm'; } from '../../../realm/realm';
import { getUser } from '../../../providers/steem/dsteem'; import { getUser } from '../../../providers/steem/dsteem';
import { switchAccount } from '../../../providers/steem/auth'; import { switchAccount } from '../../../providers/steem/auth';
@ -82,6 +81,7 @@ class ApplicationContainer extends Component {
isRenderRequire: true, isRenderRequire: true,
isReady: false, isReady: false,
isIos: Platform.OS !== 'android', isIos: Platform.OS !== 'android',
isThemeReady: false,
}; };
} }
@ -265,6 +265,8 @@ class ApplicationContainer extends Component {
if (response.nsfw !== '') dispatch(setNsfw(response.nsfw)); if (response.nsfw !== '') dispatch(setNsfw(response.nsfw));
dispatch(setCurrency(response.currency !== '' ? response.currency : 'usd')); dispatch(setCurrency(response.currency !== '' ? response.currency : 'usd'));
this.setState({ isThemeReady: true });
} }
}); });
}; };
@ -322,7 +324,7 @@ class ApplicationContainer extends Component {
render() { render() {
const { selectedLanguage, isConnected, toastNotification } = this.props; const { selectedLanguage, isConnected, toastNotification } = this.props;
const { isRenderRequire, isReady } = this.state; const { isRenderRequire, isReady, isThemeReady } = this.state;
// For testing It comented out. // For testing It comented out.
// const locale = (navigator.languages && navigator.languages[0]) // const locale = (navigator.languages && navigator.languages[0])
@ -330,7 +332,7 @@ class ApplicationContainer extends Component {
// || navigator.userLanguage // || navigator.userLanguage
// || selectedLanguage; // || selectedLanguage;
if (isRenderRequire) { if (isRenderRequire && isThemeReady) {
return ( return (
<ApplicationScreen <ApplicationScreen
isConnected={isConnected} isConnected={isConnected}