mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
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:
@@ -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 (
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user