From 1806816d9c1a655467e6ed3934beec96a6944d4a Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Thu, 20 Aug 2020 14:25:00 +0300 Subject: [PATCH] Fix DHCP check when there is no V6 interface --- client/src/actions/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/actions/index.js b/client/src/actions/index.js index 60f58453..b4a51065 100644 --- a/client/src/actions/index.js +++ b/client/src/actions/index.js @@ -387,13 +387,15 @@ export const findActiveDhcp = (name) => async (dispatch, getState) => { const hasV4Interface = !!interfaces[selectedInterface]?.ipv4_addresses; const hasV6Interface = !!interfaces[selectedInterface]?.ipv6_addresses; - if ((hasV4Interface && v4.other_server.found === STATUS_RESPONSE.ERROR) - || (hasV6Interface && v6.other_server.found === STATUS_RESPONSE.ERROR)) { + if (hasV4Interface && v4.other_server.found === STATUS_RESPONSE.ERROR) { isError = true; - dispatch(addErrorToast({ error: 'dhcp_error' })); if (v4.other_server.error) { dispatch(addErrorToast({ error: v4.other_server.error })); } + } + + if (hasV6Interface && v6.other_server.found === STATUS_RESPONSE.ERROR) { + isError = true; if (v6.other_server.error) { dispatch(addErrorToast({ error: v6.other_server.error })); } @@ -405,6 +407,7 @@ export const findActiveDhcp = (name) => async (dispatch, getState) => { } if (isError) { + dispatch(addErrorToast({ error: 'dhcp_error' })); return; }