mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 06:39:06 +08:00
feat: recommended apps list support sort by position (#2303)
This commit is contained in:
parent
10e9766fd3
commit
bc11c6a7f2
@ -38,8 +38,10 @@ const Apps: FC = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
(async () => {
|
||||||
const { categories, recommended_apps }: any = await fetchAppList()
|
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)
|
setCategories(categories)
|
||||||
setAllList(recommended_apps)
|
setAllList(sortedRecommendedApps)
|
||||||
setIsLoaded(true)
|
setIsLoaded(true)
|
||||||
})()
|
})()
|
||||||
}, [])
|
}, [])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user