mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-28 15:25:27 +08:00
fix: prevent split on undefined(#491) (#563)
This commit is contained in:
@@ -33,7 +33,12 @@ export const ToolDiffViewer: React.FC<ToolDiffViewerProps> = ({
|
|||||||
: 'bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400';
|
: 'bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400';
|
||||||
|
|
||||||
const diffLines = useMemo(
|
const diffLines = useMemo(
|
||||||
() => createDiff(oldContent, newContent),
|
() => {
|
||||||
|
if (oldContent === undefined || newContent === undefined) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return createDiff(oldContent, newContent)
|
||||||
|
},
|
||||||
[createDiff, oldContent, newContent]
|
[createDiff, oldContent, newContent]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user