From 947d2e4ff3ae68c04944da98b8c50202836cffae Mon Sep 17 00:00:00 2001 From: Gauvain Date: Mon, 1 Jun 2026 01:00:12 +0200 Subject: [PATCH] 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). --- components/TrackSheet.tsx | 2 +- components/library/LibraryItemCard.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/TrackSheet.tsx b/components/TrackSheet.tsx index 4dda0564f..8c5f38376 100644 --- a/components/TrackSheet.tsx +++ b/components/TrackSheet.tsx @@ -26,7 +26,7 @@ export const TrackSheet: React.FC = ({ const streams = useMemo( () => source?.MediaStreams?.filter((x) => x.Type === streamType), - [source], + [source, streamType], ); const selectedSteam = useMemo( diff --git a/components/library/LibraryItemCard.tsx b/components/library/LibraryItemCard.tsx index 09de500d4..c84364ce1 100644 --- a/components/library/LibraryItemCard.tsx +++ b/components/library/LibraryItemCard.tsx @@ -51,7 +51,7 @@ export const LibraryItemCard: React.FC = ({ library, ...props }) => { api, item: library, }), - [library], + [api, library], ); const itemType = useMemo(() => {