visuddhinanda il y a 3 ans
Parent
commit
e1605e8b14
1 fichiers modifiés avec 7 ajouts et 4 suppressions
  1. 7 4
      dashboard/src/components/corpus/PaliChapterChannelList.tsx

+ 7 - 4
dashboard/src/components/corpus/PaliChapterChannelList.tsx

@@ -32,11 +32,12 @@ const Widget = ({ para, channelId, openTarget = "_blank" }: IWidget) => {
         };
       });
       setTableData(newData);
+      console.log("chapter", newData);
     });
   }, [para]);
 
-  return (
-    <>
+  if (tableData.length > 0) {
+    return (
       <ChapterInChannel
         data={tableData}
         book={para.book}
@@ -44,8 +45,10 @@ const Widget = ({ para, channelId, openTarget = "_blank" }: IWidget) => {
         channelId={channelId}
         openTarget={openTarget}
       />
-    </>
-  );
+    );
+  } else {
+    return <></>;
+  }
 };
 
 export default Widget;