fix: add missing React keys to streamystats sections

Resolves React warning about missing keys in list rendering by converting fragment to array with unique key props for each streamystats component.

Also wraps promoted watchlists in a View container to properly handle props spreading, preventing props from being passed through to individual watchlist sections.
This commit is contained in:
Uruk
2026-01-12 09:37:49 +01:00
committed by Gauvain
parent f211a9ce7a
commit fd3766fc23
2 changed files with 27 additions and 26 deletions

View File

@@ -569,29 +569,31 @@ export const HomeWithCarousel = () => {
settings.streamyStatsSeriesRecommendations ||
settings.streamyStatsPromotedWatchlists;
const streamystatsSections =
index === streamystatsIndex && hasStreamystatsContent ? (
<>
{settings.streamyStatsMovieRecommendations && (
<StreamystatsRecommendations
title={t(
"home.settings.plugins.streamystats.recommended_movies",
)}
type='Movie'
/>
)}
{settings.streamyStatsSeriesRecommendations && (
<StreamystatsRecommendations
title={t(
"home.settings.plugins.streamystats.recommended_series",
)}
type='Series'
/>
)}
{settings.streamyStatsPromotedWatchlists && (
<StreamystatsPromotedWatchlists />
)}
</>
) : null;
index === streamystatsIndex && hasStreamystatsContent
? [
settings.streamyStatsMovieRecommendations && (
<StreamystatsRecommendations
key='movie-recommendations'
title={t(
"home.settings.plugins.streamystats.recommended_movies",
)}
type='Movie'
/>
),
settings.streamyStatsSeriesRecommendations && (
<StreamystatsRecommendations
key='series-recommendations'
title={t(
"home.settings.plugins.streamystats.recommended_series",
)}
type='Series'
/>
),
settings.streamyStatsPromotedWatchlists && (
<StreamystatsPromotedWatchlists key='promoted-watchlists' />
),
].filter(Boolean)
: null;
if (section.type === "InfiniteScrollingCollectionList") {
return (

View File

@@ -247,15 +247,14 @@ export const StreamystatsPromotedWatchlists: React.FC<
}
return (
<>
<View {...props}>
{watchlists?.map((watchlist) => (
<WatchlistSection
key={watchlist.id}
watchlist={watchlist}
jellyfinServerId={jellyfinServerId!}
{...props}
/>
))}
</>
</View>
);
};