From 1b22b37b09672ad270e454be8a3556f2dc52b938 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 19 Nov 2025 06:51:31 +0000 Subject: [PATCH] fix(lib): empty text fields not saving in profile forms (#437) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: antontranelis <31516529+antontranelis@users.noreply.github.com> Co-authored-by: mahula --- lib/src/Components/Input/RichTextEditor.tsx | 2 +- lib/src/Components/Profile/itemFunctions.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/Components/Input/RichTextEditor.tsx b/lib/src/Components/Input/RichTextEditor.tsx index f504e0ad..01045291 100644 --- a/lib/src/Components/Input/RichTextEditor.tsx +++ b/lib/src/Components/Input/RichTextEditor.tsx @@ -44,7 +44,7 @@ export function RichTextEditor({ const regex = /!\[.*?\]\(.*?\)/g newValue = newValue.replace(regex, (match: string) => match + '\n\n') - if (updateFormValue && newValue) { + if (updateFormValue) { updateFormValue(newValue) } } diff --git a/lib/src/Components/Profile/itemFunctions.ts b/lib/src/Components/Profile/itemFunctions.ts index b26c7142..46ae25ce 100644 --- a/lib/src/Components/Profile/itemFunctions.ts +++ b/lib/src/Components/Profile/itemFunctions.ts @@ -273,7 +273,7 @@ export const onUpdateItem = async ( setLoading(true) state.text - .toLocaleLowerCase() + ?.toLocaleLowerCase() .match(hashTagRegex) ?.map((tag) => { if (!tags.find((t) => t.name.toLocaleLowerCase() === tag.slice(1).toLocaleLowerCase())) {