mirror of
https://github.com/Radarr/Radarr
synced 2024-12-27 02:09:59 +00:00
Replace for loop with find for QueueStatus
This commit is contained in:
parent
9472af8f83
commit
d6d740a0d2
1 changed files with 4 additions and 13 deletions
|
@ -64,16 +64,7 @@ function createMapStateToProps() {
|
|||
);
|
||||
});
|
||||
|
||||
let queueStatus = null;
|
||||
let queueState = null;
|
||||
|
||||
for (const q in queueItems) {
|
||||
if (queueItems[q].movieId === movie.id) {
|
||||
queueStatus = queueItems[q].status;
|
||||
queueState = queueItems[q].trackedDownloadState;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const firstQueueItem = queueItems.find((q) => q.movieId === movie.id);
|
||||
|
||||
return {
|
||||
...movie,
|
||||
|
@ -81,8 +72,8 @@ function createMapStateToProps() {
|
|||
showSearchAction,
|
||||
isRefreshingMovie,
|
||||
isSearchingMovie,
|
||||
queueStatus,
|
||||
queueState
|
||||
queueStatus: firstQueueItem.status,
|
||||
queueState: firstQueueItem.trackedDownloadState
|
||||
};
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue