This is an automated email from the ASF dual-hosted git repository.
robin0716 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/dev by this push:
new 23729505 refactor(ui): LinkedQuestions component to handle empty data
23729505 is described below
commit 2372950563c937413969d168a0dc68aa8b8c1765
Author: robin <[email protected]>
AuthorDate: Wed Oct 16 16:06:06 2024 +0800
refactor(ui): LinkedQuestions component to handle empty data
---
ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx
b/ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx
index 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;
}