From 1fa0a9c7dd50c78faec7eb70cf7139358b8457b0 Mon Sep 17 00:00:00 2001 From: Sergey Kurdin Date: Sat, 18 Jan 2025 14:27:21 -0500 Subject: [PATCH] removed trim for clip preview --- .../pages/components/Dashboard/components/utils.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/pastebar-app-ui/src/pages/components/Dashboard/components/utils.ts b/packages/pastebar-app-ui/src/pages/components/Dashboard/components/utils.ts index 0ef9441a..00f5b6c2 100644 --- a/packages/pastebar-app-ui/src/pages/components/Dashboard/components/utils.ts +++ b/packages/pastebar-app-ui/src/pages/components/Dashboard/components/utils.ts @@ -190,9 +190,7 @@ export function getValuePreview( if (!value || isLargeView) { return { valuePreview: - isImageData && value - ? value.substring(0, 200) + '...' - : value || 'No content', + isImageData && value ? value.substring(0, 200) + '...' : value || 'No content', morePreviewLines: null, morePreviewChars: null, } @@ -222,20 +220,19 @@ export function getValuePreview( morePreviewChars: morePreviewChars > 0 ? morePreviewChars : null, } } else { - const preview = normalizedValue.trim() - const previewLines = preview.split('\n') + const previewLines = normalizedValue.split('\n') const morePreviewLines = normalizedValue.split('\n').length - previewLines.length if (isImageData) { return { - valuePreview: preview.substring(0, 60) + '...', + valuePreview: normalizedValue.substring(0, 60) + '...', morePreviewLines: null, morePreviewChars: null, } } return { - valuePreview: preview, + valuePreview: normalizedValue, morePreviewLines: morePreviewLines > 0 ? morePreviewLines : null, morePreviewChars: null, }