Skip to content

Commit

Permalink
- client: 2300 Fix block client bug when clients values are empty in …
Browse files Browse the repository at this point in the history
…config

Close #2300

Squashed commit of the following:

commit 7222a03
Merge: 91b06b1 0919611
Author: Artem Baskal <a.baskal@adguard.com>
Date:   Mon Nov 16 12:46:26 2020 +0300

    Merge branch 'master' into fix/2300

commit 91b06b1
Author: Artem Baskal <a.baskal@adguard.com>
Date:   Fri Nov 13 15:12:31 2020 +0300

    - client: 2300 Fix block client bug when clients values are empty in config
  • Loading branch information
ArtemBaskal committed Nov 16, 2020
1 parent 0919611 commit 394fc5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/src/actions/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ export const toggleClientBlockSuccess = createAction('TOGGLE_CLIENT_BLOCK_SUCCES
export const toggleClientBlock = (ip, disallowed, disallowed_rule) => async (dispatch) => {
dispatch(toggleClientBlockRequest());
try {
const {
allowed_clients, blocked_hosts, disallowed_clients = [],
} = await apiClient.getAccessList();
const accessList = await apiClient.getAccessList();
const allowed_clients = accessList.allowed_clients ?? [];
const blocked_hosts = accessList.blocked_hosts ?? [];
const disallowed_clients = accessList.disallowed_clients ?? [];

const updatedDisallowedClients = disallowed
? disallowed_clients.filter((client) => client !== disallowed_rule)
Expand Down

0 comments on commit 394fc5a

Please sign in to comment.