diff --git a/src/providers/steem/dsteem.js b/src/providers/steem/dsteem.js index 91cf22414..cfdafe988 100644 --- a/src/providers/steem/dsteem.js +++ b/src/providers/steem/dsteem.js @@ -18,7 +18,7 @@ import AUTH_TYPE from '../../constants/authType'; const DEFAULT_SERVER = 'https://api.steemit.com'; let client = new Client(DEFAULT_SERVER); -const _getClient = async () => { +export const checkClient = async () => { let selectedServer = DEFAULT_SERVER; await getServer().then((response) => { @@ -30,7 +30,7 @@ const _getClient = async () => { client = new Client(selectedServer); }; -_getClient(); +checkClient(); export const getDigitPinCode = pin => decryptKey(pin, Config.PIN_KEY); diff --git a/src/screens/settings/container/settingsContainer.js b/src/screens/settings/container/settingsContainer.js index 9c40b9076..ed7a955fc 100644 --- a/src/screens/settings/container/settingsContainer.js +++ b/src/screens/settings/container/settingsContainer.js @@ -26,7 +26,7 @@ import { } from '../../../redux/actions/applicationActions'; import { toastNotification } from '../../../redux/actions/uiAction'; import { setPushToken, getNodes } from '../../../providers/esteem/esteem'; - +import { checkClient } from '../../../providers/steem/dsteem'; // Middleware // Constants @@ -120,7 +120,8 @@ class SettingsContainer extends Component { if (isError) { dispatch(setApi(selectedApi)); } else { - setServer(server); + await setServer(server); + checkClient(); } };