Minimize data sent when adding a new Indexer, Download Client, etc
This commit is contained in:
parent
de3d7e925a
commit
47db1db861
|
@ -16,12 +16,15 @@ function getProviderState(payload, getState, section) {
|
||||||
|
|
||||||
if (item.fields) {
|
if (item.fields) {
|
||||||
pendingChanges.fields = _.reduce(item.fields, (result, field) => {
|
pendingChanges.fields = _.reduce(item.fields, (result, field) => {
|
||||||
const value = pendingFields.hasOwnProperty(field.name) ?
|
const name = field.name;
|
||||||
pendingFields[field.name] :
|
|
||||||
|
const value = pendingFields.hasOwnProperty(name) ?
|
||||||
|
pendingFields[name] :
|
||||||
field.value;
|
field.value;
|
||||||
|
|
||||||
|
// Only send the name and value to the server
|
||||||
result.push({
|
result.push({
|
||||||
...field,
|
name,
|
||||||
value
|
value
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -29,7 +32,11 @@ function getProviderState(payload, getState, section) {
|
||||||
}, []);
|
}, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.assign({}, item, pendingChanges);
|
const result = Object.assign({}, item, pendingChanges);
|
||||||
|
|
||||||
|
delete result.presets;
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default getProviderState;
|
export default getProviderState;
|
||||||
|
|
Loading…
Reference in New Issue