Browse Source

:bug: id=undefind 报错

visuddhinanda 3 năm trước cách đây
mục cha
commit
6bb093eace
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      dashboard/src/components/template/SentEdit/SentTab.tsx

+ 3 - 0
dashboard/src/components/template/SentEdit/SentTab.tsx

@@ -25,6 +25,9 @@ const Widget = ({
   const [nissayaActive, setNissayaActive] = useState<boolean>(false);
   const [commentaryActive, setCommentaryActive] = useState<boolean>(false);
   const [originalActive, setOriginalActive] = useState<boolean>(false);
+  if (typeof id === "undefined") {
+    return <></>;
+  }
   const sentId = id.split("_");
 
   const onChange = (key: string) => {