Explorar o código

title 没有的时候显示unnamed

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
43f465bfa8
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      dashboard/src/components/fts/FullTextSearchResult.tsx

+ 7 - 1
dashboard/src/components/fts/FullTextSearchResult.tsx

@@ -154,6 +154,12 @@ const FullTxtSearchResultWidget = ({
           default:
           default:
             break;
             break;
         }
         }
+        let title = "unnamed";
+        if (item.paliTitle) {
+          if (item.paliTitle.length > 0) {
+            title = item.paliTitle;
+          }
+        }
         return (
         return (
           <List.Item>
           <List.Item>
             {loading ? (
             {loading ? (
@@ -177,7 +183,7 @@ const FullTxtSearchResultWidget = ({
                 </div>
                 </div>
                 <Title level={4} style={{ fontWeight: 500 }}>
                 <Title level={4} style={{ fontWeight: 500 }}>
                   <Link to={link} target="_blank">
                   <Link to={link} target="_blank">
-                    {item.title}
+                    {item.title ? item.title : title}
                   </Link>
                   </Link>
                 </Title>
                 </Title>
                 <div style={{ display: "none" }}>
                 <div style={{ display: "none" }}>