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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user