Compare commits

...

1 Commits

Author SHA1 Message Date
Gauvain
947d2e4ff3 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).
2026-06-01 01:00:12 +02:00
2 changed files with 2 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ export const TrackSheet: React.FC<Props> = ({
const streams = useMemo( const streams = useMemo(
() => source?.MediaStreams?.filter((x) => x.Type === streamType), () => source?.MediaStreams?.filter((x) => x.Type === streamType),
[source], [source, streamType],
); );
const selectedSteam = useMemo( const selectedSteam = useMemo(

View File

@@ -51,7 +51,7 @@ export const LibraryItemCard: React.FC<Props> = ({ library, ...props }) => {
api, api,
item: library, item: library,
}), }),
[library], [api, library],
); );
const itemType = useMemo(() => { const itemType = useMemo(() => {