A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
refactor(ui): LinkedQuestions component to handle empty data
robin2372950563c9
diff --git a/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx b/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsxindex f02adb35..c5d92cbe 100644--- a/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx+++ b/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx@@ -22,6 +22,8 @@ import { Card, ListGroup } from 'react-bootstrap';import { Link } from 'react-router-dom';import { useTranslation } from 'react-i18next';+import { isEmpty } from 'lodash';+import { Icon } from '@/components';import { questionLink } from '@/services';import { pathFactory } from '@/router/pathFactory';@@ -43,7 +45,7 @@ const Index: FC<Props> = ({ id }) => {page_size: 5,});- if (!data || !data.list) {+ if (!data || isEmpty(data?.list)) {return null;}