diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index ce4cc6a67..90de92aec 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -221,7 +221,8 @@ "error": "Error", "fetch_error": "Fetching data failed, please try again or notify us at info@esteem.app", "connection_fail": "Connection Failed!", - "connection_success": "Successfully connected!" + "connection_success": "Successfully connected!", + "checking": "Cheking..." }, "post": { "reblog_alert": "Are you sure, you want to reblog?", diff --git a/src/redux/reducers/applicationReducer.js b/src/redux/reducers/applicationReducer.js index 16ed420a9..85776d92b 100644 --- a/src/redux/reducers/applicationReducer.js +++ b/src/redux/reducers/applicationReducer.js @@ -41,7 +41,7 @@ const initialState = { isLoginDone: false, isLogingOut: false, isNotificationOpen: true, - isPinCodeReqiure: false, + isPinCodeRequire: false, pinCodeNavigation: {}, language: 'en-US', loading: false, // It is lock to all screen and shows loading animation. @@ -89,13 +89,13 @@ export default function(state = initialState, action) { case OPEN_PIN_CODE_MODAL: return { ...state, - isPinCodeReqiure: true, + isPinCodeRequire: true, pinCodeNavigation: action.payload || {}, }; case CLOSE_PIN_CODE_MODAL: return { ...state, - isPinCodeReqiure: false, + isPinCodeRequire: false, }; case ACTIVE_APPLICATION: return { diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 7362ba368..7801ccc0d 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -114,9 +114,19 @@ class ApplicationContainer extends Component { }; componentWillReceiveProps(nextProps) { - const { isDarkTheme: _isDarkTheme, selectedLanguage, isLogingOut, isConnected } = this.props; + const { + isDarkTheme: _isDarkTheme, + selectedLanguage, + isLogingOut, + isConnected, + api, + } = this.props; - if (_isDarkTheme !== nextProps.isDarkTheme || selectedLanguage !== nextProps.selectedLanguage) { + if ( + _isDarkTheme !== nextProps.isDarkTheme || + selectedLanguage !== nextProps.selectedLanguage || + (api !== nextProps.api && nextProps.api) + ) { this.setState({ isRenderRequire: false }, () => this.setState({ isRenderRequire: true })); if (nextProps.isDarkTheme) { changeNavigationBarColor('#1e2835'); @@ -645,7 +655,7 @@ class ApplicationContainer extends Component { toastNotification, isDarkTheme: _isDarkTheme, children, - isPinCodeReqiure, + isPinCodeRequire, } = this.props; const { isRenderRequire, isReady, isThemeReady } = this.state; @@ -657,7 +667,7 @@ class ApplicationContainer extends Component { isReady, isRenderRequire, isThemeReady, - isPinCodeReqiure, + isPinCodeRequire, isDarkTheme: _isDarkTheme, locale: selectedLanguage, }) @@ -676,8 +686,9 @@ export default connect( isLoggedIn: state.application.isLoggedIn, isConnected: state.application.isConnected, nav: state.nav.routes, - isPinCodeReqiure: state.application.isPinCodeReqiure, + isPinCodeRequire: state.application.isPinCodeRequire, isActiveApp: state.application.isActive, + api: state.application.api, // Account unreadActivityCount: state.account.currentAccount.unread_activity_count, diff --git a/src/screens/application/index.js b/src/screens/application/index.js index f271d7414..ce940a442 100644 --- a/src/screens/application/index.js +++ b/src/screens/application/index.js @@ -17,7 +17,7 @@ const Application = () => ( isDarkTheme, isRenderRequire, isThemeReady, - isPinCodeReqiure, + isPinCodeRequire, }) => { if (!isReady || !isRenderRequire || !isThemeReady) { return ; @@ -25,7 +25,7 @@ const Application = () => ( return ( groomingServerName(serverName))} selectedOptionIndex={serverList.indexOf(selectedApi)} - defaultText={groomingServerName(selectedApi)} + defaultText={ + groomingServerName(selectedApi) || + intl.formatMessage({ + id: 'alert.checking', + }) + } handleOnChange={handleOnChange} />