From a0cfcd7ec4b105ea476ebc49b191aa8e5b0d2004 Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 22 Apr 2025 13:18:36 +0800 Subject: [PATCH] fix(mobile): enhance Recommendations component with empty state message - Added a conditional rendering for the Recommendations component to display a message when no data is available. - The new message informs users that the recommendations section is currently empty, improving user experience. These changes provide clearer feedback to users when there are no recommendations to display. Signed-off-by: Innei --- apps/mobile/src/modules/discover/Recommendations.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/mobile/src/modules/discover/Recommendations.tsx b/apps/mobile/src/modules/discover/Recommendations.tsx index ccdcf6af2..52603b330 100644 --- a/apps/mobile/src/modules/discover/Recommendations.tsx +++ b/apps/mobile/src/modules/discover/Recommendations.tsx @@ -137,6 +137,7 @@ export const RecommendationTab: TabComponent<{ if (!data) { return [] } + return Object.keys(data).sort((a, b) => { const aname = data[a]!.name const bname = data[b]!.name @@ -226,6 +227,14 @@ export const RecommendationTab: TabComponent<{ return } + if (keys.length === 0) { + return ( + + This is a barren wasteland of knowledge. + + ) + } + return (