mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 16:43:25 +01:00
Fixed: Don't try to render quality when it's null
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
34fff4ef26
commit
0042fadcb0
2 changed files with 11 additions and 9 deletions
|
|
@ -45,6 +45,10 @@ function MovieQuality(props) {
|
||||||
kind = kinds.INVERSE;
|
kind = kinds.INVERSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!quality) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Label
|
<Label
|
||||||
className={className}
|
className={className}
|
||||||
|
|
|
||||||
|
|
@ -233,17 +233,15 @@ 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);
|
||||||
const item = Object.assign({}, items[index], payload);
|
|
||||||
|
|
||||||
newState.items = [...items];
|
// Don't try to update if there isnt a matching item (the user closed the modal)
|
||||||
newState.items.splice(index, 1, item);
|
if (index >= 0) {
|
||||||
|
const item = Object.assign({}, items[index], payload);
|
||||||
|
|
||||||
|
newState.items = [...items];
|
||||||
|
newState.items.splice(index, 1, item);
|
||||||
|
}
|
||||||
|
|
||||||
return newState;
|
return newState;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue