Просмотр исходного кода

逐词解析没有创建不显示讨论按钮

visuddhinanda 2 лет назад
Родитель
Сommit
79d9fdfc83
1 измененных файлов с 12 добавлено и 11 удалено
  1. 12 11
      dashboard/src/components/template/Wbw/WbwDetail.tsx

+ 12 - 11
dashboard/src/components/template/Wbw/WbwDetail.tsx

@@ -29,7 +29,6 @@ const WbwDetailWidget = ({
 }: IWidget) => {
   const intl = useIntl();
   const [currWbwData, setCurrWbwData] = useState(data);
-
   useEffect(() => {
     setCurrWbwData(data);
   }, [data]);
@@ -110,16 +109,18 @@ const WbwDetailWidget = ({
         size="small"
         type="card"
         tabBarExtraContent={
-          <CommentBox
-            resId={data.uid}
-            resType="wbw"
-            trigger={<Button icon={<CommentOutlined />} type="text" />}
-            onCommentCountChange={(count: number) => {
-              if (typeof onCommentCountChange !== "undefined") {
-                onCommentCountChange(count);
-              }
-            }}
-          />
+          data.uid ? (
+            <CommentBox
+              resId={data.uid}
+              resType="wbw"
+              trigger={<Button icon={<CommentOutlined />} type="text" />}
+              onCommentCountChange={(count: number) => {
+                if (typeof onCommentCountChange !== "undefined") {
+                  onCommentCountChange(count);
+                }
+              }}
+            />
+          ) : undefined
         }
         items={[
           {