Browse Source

没有channel不显示

visuddhinanda 3 years ago
parent
commit
4f96cd94ca
1 changed files with 3 additions and 1 deletions
  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>
         )}
       />
+    ) : (
+      <></>
     );
   };