Browse Source

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

visuddhinanda 3 years ago
parent
commit
79d9fdfc83
1 changed files with 12 additions and 11 deletions
  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={[
           {