parent
9702d2e5ad
commit
91de7ff11c
|
@ -35,6 +35,10 @@ function EpisodeQuality(props) {
|
||||||
isCutoffNotMet
|
isCutoffNotMet
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
if (!quality) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Label
|
<Label
|
||||||
className={className}
|
className={className}
|
||||||
|
|
|
@ -261,17 +261,16 @@ export const reducers = createHandleActions({
|
||||||
const guid = payload.guid;
|
const guid = payload.guid;
|
||||||
const newState = Object.assign({}, state);
|
const newState = Object.assign({}, state);
|
||||||
const items = newState.items;
|
const items = newState.items;
|
||||||
|
|
||||||
// Return early if there aren't any items (the user closed the modal)
|
|
||||||
if (!items.length) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const index = items.findIndex((item) => item.guid === guid);
|
const index = items.findIndex((item) => item.guid === guid);
|
||||||
|
|
||||||
|
// Don't try to update if there isnt a matching item (the user closed the modal)
|
||||||
|
|
||||||
|
if (index >= 0) {
|
||||||
const item = Object.assign({}, items[index], payload);
|
const item = Object.assign({}, items[index], payload);
|
||||||
|
|
||||||
newState.items = [...items];
|
newState.items = [...items];
|
||||||
newState.items.splice(index, 1, item);
|
newState.items.splice(index, 1, item);
|
||||||
|
}
|
||||||
|
|
||||||
return newState;
|
return newState;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue