Merge: - client: Fix delay of custom filter editor

Merge in DNS/adguard-home from fix/1657 to master
Fix #1657

* commit '474306d46546097700d5c767c7283f33f63f53d7':
  - client: Fix delay of custom filter editor
This commit is contained in:
Andrey Meshkov 2020-09-09 15:48:41 +03:00
commit 0818d51493
2 changed files with 5 additions and 3 deletions

View File

@ -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 })));

View File

@ -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);