### What problem does this PR solve? feat: Catching errors with IndentedTree #2247 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
||||
Space,
|
||||
Tag,
|
||||
} from 'antd';
|
||||
import { useState } from 'react';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import MarkdownContent from '../chat/markdown-content';
|
||||
import { useFetchBackgroundImage, useSendQuestion } from './hooks';
|
||||
@@ -35,7 +35,6 @@ const SearchPage = () => {
|
||||
const { t } = useTranslation();
|
||||
const [checkedList, setCheckedList] = useState<string[]>([]);
|
||||
const { chunks, total } = useSelectTestingResult();
|
||||
// const appConf = useFetchAppConf();
|
||||
const {
|
||||
sendQuestion,
|
||||
handleClickRelatedQuestion,
|
||||
@@ -62,6 +61,14 @@ const SearchPage = () => {
|
||||
handleTestChunk(selectedDocumentIds, pageNumber, pageSize);
|
||||
};
|
||||
|
||||
const isMindMapEmpty = useMemo(() => {
|
||||
return (
|
||||
!mindMapLoading &&
|
||||
((Array.isArray(mindMap?.children) && mindMap.children.length === 0) ||
|
||||
!Array.isArray(mindMap?.children))
|
||||
);
|
||||
}, [mindMap, mindMapLoading]);
|
||||
|
||||
const InputSearch = (
|
||||
<Search
|
||||
value={searchStr}
|
||||
@@ -103,7 +110,9 @@ const SearchPage = () => {
|
||||
</Flex>
|
||||
) : (
|
||||
<Flex className={styles.content}>
|
||||
<section className={styles.main}>
|
||||
<section
|
||||
className={isMindMapEmpty ? styles.largeMain : styles.main}
|
||||
>
|
||||
{InputSearch}
|
||||
{answer.answer && (
|
||||
<div className={styles.answerWrapper}>
|
||||
@@ -165,7 +174,9 @@ const SearchPage = () => {
|
||||
onChange={onChange}
|
||||
/>
|
||||
</section>
|
||||
<section className={styles.graph}>
|
||||
<section
|
||||
className={isMindMapEmpty ? styles.hide : styles.graph}
|
||||
>
|
||||
{mindMapLoading ? (
|
||||
<Skeleton active />
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user