فهرست منبع

Merge pull request #8455 from weseek/fix/140308-when-the-revision-body-is-empty-no-differences-are-detected

fix: When the revision body is empty no differences are detected
Yuki Takei 2 سال پیش
والد
کامیت
296915d1b9
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      apps/app/src/components/PageHistory/RevisionDiff.tsx

+ 3 - 2
apps/app/src/components/PageHistory/RevisionDiff.tsx

@@ -3,7 +3,8 @@ import React from 'react';
 import type { IRevisionHasPageId } from '@growi/core';
 import type { IRevisionHasPageId } from '@growi/core';
 import { returnPathForURL } from '@growi/core/dist/utils/path-utils';
 import { returnPathForURL } from '@growi/core/dist/utils/path-utils';
 import { createPatch } from 'diff';
 import { createPatch } from 'diff';
-import { html, Diff2HtmlConfig } from 'diff2html';
+import type { Diff2HtmlConfig } from 'diff2html';
+import { html } from 'diff2html';
 import { useTranslation } from 'next-i18next';
 import { useTranslation } from 'next-i18next';
 import Link from 'next/link';
 import Link from 'next/link';
 import urljoin from 'url-join';
 import urljoin from 'url-join';
@@ -43,7 +44,7 @@ export const RevisionDiff = (props: RevisioinDiffProps): JSX.Element => {
     drawFileList: false,
     drawFileList: false,
   };
   };
 
 
-  const diffViewHTML = (currentRevision.body && previousRevision.body && revisionDiffOpened) ? html(patch, option) : '';
+  const diffViewHTML = revisionDiffOpened ? html(patch, option) : '';
 
 
   const diffView = { __html: diffViewHTML };
   const diffView = { __html: diffViewHTML };