fix: fetchAppWithTags may return empty when apps is over 100 (#23350)
This commit is contained in:
@@ -20,7 +20,7 @@ import cn from '@/utils/classnames'
|
||||
import { useStore } from '@/app/components/app/store'
|
||||
import AppSideBar from '@/app/components/app-sidebar'
|
||||
import type { NavIcon } from '@/app/components/app-sidebar/navLink'
|
||||
import { fetchAppDetail, fetchAppWithTags } from '@/service/apps'
|
||||
import { fetchAppDetailDirect } from '@/service/apps'
|
||||
import { useAppContext } from '@/context/app-context'
|
||||
import Loading from '@/app/components/base/loading'
|
||||
import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
|
||||
@@ -118,17 +118,7 @@ const AppDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
|
||||
useEffect(() => {
|
||||
setAppDetail()
|
||||
setIsLoadingAppDetail(true)
|
||||
fetchAppDetail({ url: '/apps', id: appId }).then(async (res) => {
|
||||
if (!res.tags || res.tags.length === 0) {
|
||||
try {
|
||||
const appWithTags = await fetchAppWithTags(appId)
|
||||
if (appWithTags?.tags)
|
||||
res.tags = appWithTags.tags
|
||||
}
|
||||
catch (error) {
|
||||
// Fallback failed, continue with empty tags
|
||||
}
|
||||
}
|
||||
fetchAppDetailDirect({ url: '/apps', id: appId }).then((res: App) => {
|
||||
setAppDetailRes(res)
|
||||
}).catch((e: any) => {
|
||||
if (e.status === 404)
|
||||
|
Reference in New Issue
Block a user