diff --git a/src/libs/DraftCommentUtils.ts b/src/libs/DraftCommentUtils.ts index 325da93d235e..b3cb32498725 100644 --- a/src/libs/DraftCommentUtils.ts +++ b/src/libs/DraftCommentUtils.ts @@ -25,7 +25,7 @@ function getDraftComment(reportID: string): OnyxEntry | null | undefined * A valid draft comment is a non-empty string. */ function isValidDraftComment(comment?: string | null): boolean { - return !!comment?.trim(); + return !!comment; } /** @@ -36,12 +36,12 @@ function hasValidDraftComment(reportID: string): boolean { } /** - * Prepares a draft comment by trimming it and returning null if it's empty. + * Prepares a draft comment by returning null if it's empty. */ function prepareDraftComment(comment: string | null) { // logical OR is used to convert empty string to null // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing - return comment?.trim() || null; + return comment || null; } export {getDraftComment, isValidDraftComment, hasValidDraftComment, prepareDraftComment};