From e1582102aa88e429dbf3b9ae9b362b9755e43be0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 23 May 2022 18:30:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=88=97=E8=A1=A8message?= =?UTF-8?q?=E5=8F=AA=E6=98=BE=E7=A4=BA=E7=AC=AC=E4=B8=80=E8=A1=8C=E7=9A=84?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepotCatalogue.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/forge/Main/CoderDepotCatalogue.jsx b/src/forge/Main/CoderDepotCatalogue.jsx index f36448a80..dd0bf27da 100644 --- a/src/forge/Main/CoderDepotCatalogue.jsx +++ b/src/forge/Main/CoderDepotCatalogue.jsx @@ -9,6 +9,11 @@ const typeIco = { } function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform }){ + // 只显示第一个换行符前的内容 + function getMessage(value){ + let str = value.indexOf('\n') > 0 && value.split('\n'); + return str[0]; + } return(
  • @@ -23,7 +28,7 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId , platform - {item.commit && item.commit.message} + {getMessage(item.commit && item.commit.message)} {item.commit && item.commit.time_from_now}