removed trim for clip preview

This commit is contained in:
Sergey Kurdin 2025-01-18 14:27:21 -05:00
parent f4928f463a
commit 1fa0a9c7dd

View File

@ -190,9 +190,7 @@ export function getValuePreview(
if (!value || isLargeView) { if (!value || isLargeView) {
return { return {
valuePreview: valuePreview:
isImageData && value isImageData && value ? value.substring(0, 200) + '...' : value || 'No content',
? value.substring(0, 200) + '...'
: value || 'No content',
morePreviewLines: null, morePreviewLines: null,
morePreviewChars: null, morePreviewChars: null,
} }
@ -222,20 +220,19 @@ export function getValuePreview(
morePreviewChars: morePreviewChars > 0 ? morePreviewChars : null, morePreviewChars: morePreviewChars > 0 ? morePreviewChars : null,
} }
} else { } else {
const preview = normalizedValue.trim() const previewLines = normalizedValue.split('\n')
const previewLines = preview.split('\n')
const morePreviewLines = normalizedValue.split('\n').length - previewLines.length const morePreviewLines = normalizedValue.split('\n').length - previewLines.length
if (isImageData) { if (isImageData) {
return { return {
valuePreview: preview.substring(0, 60) + '...', valuePreview: normalizedValue.substring(0, 60) + '...',
morePreviewLines: null, morePreviewLines: null,
morePreviewChars: null, morePreviewChars: null,
} }
} }
return { return {
valuePreview: preview, valuePreview: normalizedValue,
morePreviewLines: morePreviewLines > 0 ? morePreviewLines : null, morePreviewLines: morePreviewLines > 0 ? morePreviewLines : null,
morePreviewChars: null, morePreviewChars: null,
} }