diff --git a/web/app/components/explore/app-list/index.tsx b/web/app/components/explore/app-list/index.tsx index 9031bb6299..058aa541c3 100644 --- a/web/app/components/explore/app-list/index.tsx +++ b/web/app/components/explore/app-list/index.tsx @@ -26,7 +26,8 @@ const Apps: FC = () => { const { isCurrentWorkspaceManager } = useAppContext() const router = useRouter() const { hasEditPermission } = useContext(ExploreContext) - const allCategoriesEn = t('explore.apps.allCategories') + const allCategoriesEn = t('explore.apps.allCategories', { lng: 'en' }) + const [currCategory, setCurrCategory] = useTabSearchParams({ defaultTab: allCategoriesEn, }) @@ -47,11 +48,10 @@ const Apps: FC = () => { }, ) - const currList = (() => { - if (currCategory === allCategoriesEn) - return allList - return allList.filter(item => item.category === currCategory) - })() + const currList + = currCategory === allCategoriesEn + ? allList + : allList.filter(item => item.category === currCategory) const [currApp, setCurrApp] = React.useState(null) const [isShowCreateModal, setIsShowCreateModal] = React.useState(false) @@ -112,6 +112,7 @@ const Apps: FC = () => { list={categories} value={currCategory} onChange={setCurrCategory} + allCategoriesEn={allCategoriesEn} />