jam411 vor 3 Jahren
Ursprung
Commit
83a1a0ff4b

+ 2 - 5
packages/app/src/components/PageComment.tsx

@@ -19,9 +19,9 @@ import DeleteCommentModal from './PageComment/DeleteCommentModal';
 import { ReplayComments } from './PageComment/ReplayComments';
 import { ReplayComments } from './PageComment/ReplayComments';
 
 
 type Props = {
 type Props = {
-  isReadOnly : boolean,
+  isReadOnly: boolean,
   titleAlign?: 'center' | 'left' | 'right',
   titleAlign?: 'center' | 'left' | 'right',
-  highlightKeywords?:string[],
+  highlightKeywords?: string[],
   hideIfEmpty?: boolean,
   hideIfEmpty?: boolean,
 }
 }
 
 
@@ -60,7 +60,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
   }, [highlightKeywords]);
   }, [highlightKeywords]);
 
 
   useEffect(() => {
   useEffect(() => {
-
     if (comments != null) {
     if (comments != null) {
       const preprocessedCommentList: string[] = comments.map((comment) => {
       const preprocessedCommentList: string[] = comments.map((comment) => {
         const highlightedComment: string = highlightComment(comment.comment);
         const highlightedComment: string = highlightComment(comment.comment);
@@ -71,7 +70,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
       });
       });
       setFormatedComments(preprocessedComments);
       setFormatedComments(preprocessedComments);
     }
     }
-
   }, [comments, highlightComment]);
   }, [comments, highlightComment]);
 
 
   if (commentsFromOldest != null) {
   if (commentsFromOldest != null) {
@@ -117,7 +115,6 @@ export const PageComment: FC<Props> = memo((props:Props): JSX.Element => {
     });
     });
   }, []);
   }, []);
 
 
-
   if (commentsFromOldest == null || commentsExceptReply == null) return <></>;
   if (commentsFromOldest == null || commentsExceptReply == null) return <></>;
 
 
   if (hideIfEmpty && comments?.length === 0) {
   if (hideIfEmpty && comments?.length === 0) {

+ 1 - 1
packages/app/src/components/SearchPage/SearchResultContent.tsx

@@ -214,7 +214,7 @@ export const SearchResultContent: FC<Props> = (props: Props) => {
           revisionId={page.revision}
           revisionId={page.revision}
           highlightKeywords={highlightKeywords}
           highlightKeywords={highlightKeywords}
         />
         />
-        <PageComment pageId={page._id} highlightKeywords={highlightKeywords} isReadOnly hideIfEmpty />
+        <PageComment highlightKeywords={highlightKeywords} isReadOnly hideIfEmpty />
         <PageContentFooter
         <PageContentFooter
           // createdAt={new Date(pageWithMeta.data.createdAt)}
           // createdAt={new Date(pageWithMeta.data.createdAt)}
           // updatedAt={new Date(pageWithMeta.data.updatedAt)}
           // updatedAt={new Date(pageWithMeta.data.updatedAt)}