From bc11c6a7f21862e682a0024b3ffb7e4cb0ccce10 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 31 Jan 2024 11:00:44 +0800 Subject: [PATCH] feat: recommended apps list support sort by position (#2303) --- web/app/components/explore/app-list/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/app/components/explore/app-list/index.tsx b/web/app/components/explore/app-list/index.tsx index 307145992e..02a49782ec 100644 --- a/web/app/components/explore/app-list/index.tsx +++ b/web/app/components/explore/app-list/index.tsx @@ -38,8 +38,10 @@ const Apps: FC = () => { useEffect(() => { (async () => { const { categories, recommended_apps }: any = await fetchAppList() + const sortedRecommendedApps = [...recommended_apps] + sortedRecommendedApps.sort((a, b) => a.position - b.position) // position from small to big setCategories(categories) - setAllList(recommended_apps) + setAllList(sortedRecommendedApps) setIsLoaded(true) })() }, [])