mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
fix: library sorting persistence by adding missing useEffect dependencies (#1047)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: lostb1t <168401+lostb1t@users.noreply.github.com> Co-authored-by: lance chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
@@ -77,7 +77,13 @@ const Page = () => {
|
||||
} else {
|
||||
_setSortBy([SortByOption.SortName]);
|
||||
}
|
||||
}, []);
|
||||
}, [
|
||||
libraryId,
|
||||
sortOrderPreference,
|
||||
sortByPreference,
|
||||
_setSortOrder,
|
||||
_setSortBy,
|
||||
]);
|
||||
|
||||
const setSortBy = useCallback(
|
||||
(sortBy: SortByOption[]) => {
|
||||
@@ -87,7 +93,7 @@ const Page = () => {
|
||||
}
|
||||
_setSortBy(sortBy);
|
||||
},
|
||||
[libraryId, sortByPreference],
|
||||
[libraryId, sortByPreference, setSortByPreference, _setSortBy],
|
||||
);
|
||||
|
||||
const setSortOrder = useCallback(
|
||||
@@ -101,7 +107,7 @@ const Page = () => {
|
||||
}
|
||||
_setSortOrder(sortOrder);
|
||||
},
|
||||
[libraryId, sortOrderPreference],
|
||||
[libraryId, sortOrderPreference, setOderByPreference, _setSortOrder],
|
||||
);
|
||||
|
||||
const nrOfCols = useMemo(() => {
|
||||
|
||||
Reference in New Issue
Block a user