Skip to content

Commit

Permalink
fix: 4208 - Empty title with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-jan committed Dec 4, 2024
1 parent 9e634c7 commit 308a26b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/containers/Providers/ModelHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function ModelHandler() {

// Remove non-alphanumeric characters
const cleanedMessageContent = messageContent
.replace(/[^a-z0-9\s]/gi, '')
.replace(/[^\p{L}\s]+/gu, '')
.trim()

// Split the message into words
Expand All @@ -147,6 +147,9 @@ export default function ModelHandler() {
return
}

// Do not persist empty message
if (!cleanedMessageContent.trim().length) return

const updatedThread: Thread = {
...thread,

Expand Down

0 comments on commit 308a26b

Please sign in to comment.