diff --git a/ui/src/components/DiffContent/index.tsx b/ui/src/components/DiffContent/index.tsx index 2becb18d..922e25c1 100644 --- a/ui/src/components/DiffContent/index.tsx +++ b/ui/src/components/DiffContent/index.tsx @@ -1,5 +1,7 @@ import { FC, memo } from 'react'; +import clssnames from 'classnames'; + import { Tag } from '@/components'; import { diffText } from '@/utils'; @@ -74,7 +76,7 @@ const Index: FC = ({ )} {objectType === 'question' && (
- {tag.map((item) => { + {tag?.map((item) => { return ( = ({
)} {objectType === 'tag' && opts?.showTagUrlSlug && ( -
+
{`/tags/${ newData?.main_tag_slug_name ? diffText( diff --git a/ui/src/utils/common.ts b/ui/src/utils/common.ts index 9b2eee69..1b8ac340 100644 --- a/ui/src/utils/common.ts +++ b/ui/src/utils/common.ts @@ -170,7 +170,7 @@ function diffText(newText: string, oldText: string): string { return ''; } - if (!oldText) { + if (typeof oldText !== 'string') { return newText ?.replace(/\n/gi, '
') ?.replace(/