diff --git a/client/src/actions/index.js b/client/src/actions/index.js index ff039af1..d39975ea 100644 --- a/client/src/actions/index.js +++ b/client/src/actions/index.js @@ -571,10 +571,10 @@ export const toggleBlocking = ( const matchPreparedUnblockingRule = userRules.match(preparedUnblockingRule); if (matchPreparedBlockingRule) { - dispatch(setRules(userRules.replace(`${blockingRule}`, ''))); + await dispatch(setRules(userRules.replace(`${blockingRule}`, ''))); dispatch(addSuccessToast(i18next.t('rule_removed_from_custom_filtering_toast', { rule: blockingRule }))); } else if (!matchPreparedUnblockingRule) { - dispatch(setRules(`${userRules}${lineEnding}${unblockingRule}\n`)); + await dispatch(setRules(`${userRules}${lineEnding}${unblockingRule}\n`)); dispatch(addSuccessToast(i18next.t('rule_added_to_custom_filtering_toast', { rule: unblockingRule }))); } else if (matchPreparedUnblockingRule) { dispatch(addSuccessToast(i18next.t('rule_added_to_custom_filtering_toast', { rule: unblockingRule }))); diff --git a/client/src/components/Logs/Cells/ClientCell.js b/client/src/components/Logs/Cells/ClientCell.js index fd9875bf..a468bfcb 100644 --- a/client/src/components/Logs/Cells/ClientCell.js +++ b/client/src/components/Logs/Cells/ClientCell.js @@ -84,7 +84,9 @@ const ClientCell = ({ }, }; - const onClick = () => dispatch(toggleBlocking(buttonType, domain)); + const onClick = async () => { + await dispatch(toggleBlocking(buttonType, domain)); + }; const getOptions = (optionToActionMap) => { const options = Object.entries(optionToActionMap);