mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-04-30 13:11:37 +03:00
- client: Submit setFiltersConfig action on if the values are changed: Merge pull request #637 in DNS/adguard-home from fix/1749 to master
Close #1749 Squashed commit of the following: commit aaf4ba86429670ea8b0001325562c4a173be5b4a Author: ArtemBaskal <a.baskal@adguard.com> Date: Fri May 29 13:29:44 2020 +0300 - client: Submit setFiltersConfig action on if the values are changed
This commit is contained in:
parent
72f253f62b
commit
b8032801a2
4 changed files with 38 additions and 22 deletions
client/src/helpers
|
@ -482,6 +482,19 @@ export const getCurrentFilter = (url, filters) => {
|
|||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {object} initialValues
|
||||
* @param {object} values
|
||||
* @returns {object} Returns different values of objects
|
||||
*/
|
||||
export const getObjDiff = (initialValues, values) => Object.entries(values)
|
||||
.reduce((acc, [key, value]) => {
|
||||
if (value !== initialValues[key]) {
|
||||
acc[key] = value;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
/**
|
||||
* @param number Number to format
|
||||
* @returns string Returns a string with a language-sensitive representation of this number
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue