1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-19 21:46:43 -04:00

Fix sorting direction on series index component

This commit is contained in:
Bogdan
2026-01-28 17:56:00 +02:00
committed by Mark McDowall
parent 1033849d39
commit e8020b7289
2 changed files with 5 additions and 8 deletions
@@ -81,7 +81,7 @@ export const createOptionsStore = <T extends TSettings>(
sortDirection,
}: {
sortKey: string;
sortDirection: SortDirection | undefined;
sortDirection?: SortDirection;
}) => {
// @ts-expect-error - Cannot verify if T has sortKey and sortDirection
store.setState((state) => {
@@ -176,7 +176,7 @@ export const applySort = <T extends TSettings>(
sortKey: string,
sortDirection: SortDirection | undefined
) => {
if ('sortKey' in state === false || 'sortDirection' in state === false) {
if (!('sortKey' in state) || !('sortDirection' in state)) {
return state;
}
+3 -6
View File
@@ -125,12 +125,9 @@ const SeriesIndex = withScrollPosition((props: SeriesIndexProps) => {
[scrollerRef]
);
const onSortSelect = useCallback(
(value: string) => {
setSeriesSort({ sortKey: value, sortDirection });
},
[sortDirection]
);
const onSortSelect = useCallback((value: string) => {
setSeriesSort({ sortKey: value });
}, []);
const onFilterSelect = useCallback((value: string | number) => {
setSeriesOption('selectedFilterKey', value);