mirror of
https://github.com/Sonarr/Sonarr
synced 2025-01-20 14:19:46 +00:00
Fixed: Improve performance in Select Series Modal
This commit is contained in:
parent
bde5f68142
commit
1ad722acda
1 changed files with 14 additions and 9 deletions
|
@ -163,16 +163,21 @@ function SelectSeriesModalContent(props: SelectSeriesModalContentProps) {
|
||||||
[allSeries, onSeriesSelect]
|
[allSeries, onSeriesSelect]
|
||||||
);
|
);
|
||||||
|
|
||||||
const items = useMemo(() => {
|
const sortedSeries = useMemo(
|
||||||
const sorted = [...allSeries].sort(sortByProp('sortTitle'));
|
() => [...allSeries].sort(sortByProp('sortTitle')),
|
||||||
|
[allSeries]
|
||||||
|
);
|
||||||
|
|
||||||
return sorted.filter(
|
const items = useMemo(
|
||||||
|
() =>
|
||||||
|
sortedSeries.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.title.toLowerCase().includes(filter.toLowerCase()) ||
|
item.title.toLowerCase().includes(filter.toLowerCase()) ||
|
||||||
item.tvdbId.toString().includes(filter) ||
|
item.tvdbId.toString().includes(filter) ||
|
||||||
item.imdbId?.includes(filter)
|
item.imdbId?.includes(filter)
|
||||||
|
),
|
||||||
|
[sortedSeries, filter]
|
||||||
);
|
);
|
||||||
}, [allSeries, filter]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalContent onModalClose={onModalClose}>
|
<ModalContent onModalClose={onModalClose}>
|
||||||
|
|
Loading…
Reference in a new issue