diff --git a/client/src/actions/index.js b/client/src/actions/index.js index 88e14ef9..351b8221 100644 --- a/client/src/actions/index.js +++ b/client/src/actions/index.js @@ -227,7 +227,22 @@ export const getDnsStatus = () => async (dispatch) => { dispatch(getTlsStatus()); } catch (error) { dispatch(addErrorToast({ error })); - dispatch(initSettingsFailure()); + dispatch(dnsStatusFailure()); + } +}; + +export const getDnsSettingsRequest = createAction('GET_DNS_SETTINGS_REQUEST'); +export const getDnsSettingsFailure = createAction('GET_DNS_SETTINGS_FAILURE'); +export const getDnsSettingsSuccess = createAction('GET_DNS_SETTINGS_SUCCESS'); + +export const getDnsSettings = () => async (dispatch) => { + dispatch(getDnsSettingsRequest()); + try { + const dnsStatus = await apiClient.getGlobalStatus(); + dispatch(getDnsSettingsSuccess(dnsStatus)); + } catch (error) { + dispatch(addErrorToast({ error })); + dispatch(getDnsSettingsFailure()); } }; @@ -279,7 +294,7 @@ export const setUpstream = config => async (dispatch) => { await apiClient.setUpstream(values); dispatch(addSuccessToast('updated_upstream_dns_toast')); - dispatch(setUpstreamSuccess()); + dispatch(setUpstreamSuccess(config)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(setUpstreamFailure()); diff --git a/client/src/components/Settings/Dns/Access/Form.js b/client/src/components/Settings/Dns/Access/Form.js index 9096102d..29c9bc8b 100644 --- a/client/src/components/Settings/Dns/Access/Form.js +++ b/client/src/components/Settings/Dns/Access/Form.js @@ -5,7 +5,9 @@ import { Trans, withNamespaces } from 'react-i18next'; import flow from 'lodash/flow'; const Form = (props) => { - const { handleSubmit, submitting, invalid } = props; + const { + handleSubmit, submitting, invalid, processingSet, + } = props; return (