Skip to content

Commit 2372950

Browse files
committed
refactor(ui): LinkedQuestions component to handle empty data
1 parent 1e82b04 commit 2372950

File tree

1 file changed

+3
-1
lines changed
  • ui/src/pages/Questions/Detail/components/LinkedQuestions

1 file changed

+3
-1
lines changed

ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import { Card, ListGroup } from 'react-bootstrap';
2222
import { Link } from 'react-router-dom';
2323
import { useTranslation } from 'react-i18next';
2424

25+
import { isEmpty } from 'lodash';
26+
2527
import { Icon } from '@/components';
2628
import { questionLink } from '@/services';
2729
import { pathFactory } from '@/router/pathFactory';
@@ -43,7 +45,7 @@ const Index: FC<Props> = ({ id }) => {
4345
page_size: 5,
4446
});
4547

46-
if (!data || !data.list) {
48+
if (!data || isEmpty(data?.list)) {
4749
return null;
4850
}
4951

0 commit comments

Comments
 (0)