mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-01 03:28:27 +01:00
fix(hooks): correct useMemo dependency arrays
Two memos read values missing from their dependency arrays: - TrackSheet: the MediaStreams filter uses streamType (add it). - LibraryItemCard: the route memo uses api (add it). Prevents stale memoized values when those inputs change (e.g. api after re-login).
This commit is contained in:
@@ -26,7 +26,7 @@ export const TrackSheet: React.FC<Props> = ({
|
||||
|
||||
const streams = useMemo(
|
||||
() => source?.MediaStreams?.filter((x) => x.Type === streamType),
|
||||
[source],
|
||||
[source, streamType],
|
||||
);
|
||||
|
||||
const selectedSteam = useMemo(
|
||||
|
||||
@@ -51,7 +51,7 @@ export const LibraryItemCard: React.FC<Props> = ({ library, ...props }) => {
|
||||
api,
|
||||
item: library,
|
||||
}),
|
||||
[library],
|
||||
[api, library],
|
||||
);
|
||||
|
||||
const itemType = useMemo(() => {
|
||||
|
||||
Reference in New Issue
Block a user