1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-25 09:18:34 +00:00

Minimize data sent when adding a new Indexer, Download Client, etc

This commit is contained in:
Mark McDowall 2019-01-30 18:26:18 -08:00
parent de3d7e925a
commit 47db1db861

View file

@ -16,12 +16,15 @@ function getProviderState(payload, getState, section) {
if (item.fields) {
pendingChanges.fields = _.reduce(item.fields, (result, field) => {
const value = pendingFields.hasOwnProperty(field.name) ?
pendingFields[field.name] :
const name = field.name;
const value = pendingFields.hasOwnProperty(name) ?
pendingFields[name] :
field.value;
// Only send the name and value to the server
result.push({
...field,
name,
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;