Explorar el Código

contentType === "json" 显示 NissayaSent

visuddhinanda hace 1 día
padre
commit
f077608a18
Se han modificado 1 ficheros con 11 adiciones y 2 borrados
  1. 11 2
      dashboard-v6/src/components/sentence/SentCell.tsx

+ 11 - 2
dashboard-v6/src/components/sentence/SentCell.tsx

@@ -190,6 +190,8 @@ const SentCellWidget = ({
       .finally(() => setLoading(false));
   };
 
+  console.debug("sentence data", sentData, value);
+
   return (
     <div style={{ marginBottom: "8px", backgroundColor: bgColor }}>
       {loading ? <LoadingOutlined /> : <></>}
@@ -436,8 +438,15 @@ const SentCellWidget = ({
                   content={sentData.content}
                   oldContent={diffText}
                 />
-              ) : sentData.channel.type === "nissaya" ? (
-                <NissayaSent data={JSON.parse(sentData.content ?? "[])")} />
+              ) : sentData.channel.type === "nissaya" &&
+                sentData.contentType === "json" ? (
+                <NissayaSent
+                  data={JSON.parse(
+                    sentData.content && sentData.content !== ""
+                      ? sentData.content
+                      : "[]"
+                  )}
+                />
               ) : (
                 <MdView
                   className="sentence"