- client: Fix delay of custom filter editor

This commit is contained in:
ArtemBaskal 2020-09-03 23:05:11 +03:00
parent 07db05dd80
commit 474306d465
2 changed files with 5 additions and 3 deletions

View File

@ -561,10 +561,10 @@ export const toggleBlocking = (type, domain) => async (dispatch, getState) => {
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

@ -59,7 +59,9 @@ const ClientCell = ({
'btn-outline-danger': !isFiltered,
});
const onClick = () => dispatch(toggleBlocking(buttonType, domain));
const onClick = async () => {
await dispatch(toggleBlocking(buttonType, domain));
};
return <button
type="button"