mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-03-14 22:48:35 +03:00
- client: Fix delay of custom filter editor
This commit is contained in:
parent
07db05dd80
commit
474306d465
2 changed files with 5 additions and 3 deletions
|
@ -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 })));
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue