소스 검색

没有channel不显示

visuddhinanda 3 년 전
부모
커밋
4f96cd94ca
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      dashboard/src/components/corpus/ChapterInChannel.tsx

+ 3 - 1
dashboard/src/components/corpus/ChapterInChannel.tsx

@@ -37,7 +37,7 @@ const Widget = ({
   const intl = useIntl(); //i18n
   const [open, setOpen] = useState(false);
   const ChannelList = (channels: IChapterChannelData[]): JSX.Element => {
-    return (
+    return channels.length ? (
       <List
         style={{ maxWidth: 500 }}
         itemLayout="vertical"
@@ -87,6 +87,8 @@ const Widget = ({
           </List.Item>
         )}
       />
+    ) : (
+      <></>
     );
   };