Merge pull request #4212 from janhq/fix/4208-should-not-filter-out-special-chars-on-title-update
fix: 4208 - Empty title with special characters
This commit is contained in:
commit
9c5a6e2e99
@ -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
|
||||
@ -147,6 +147,9 @@ export default function ModelHandler() {
|
||||
return
|
||||
}
|
||||
|
||||
// Do not persist empty message
|
||||
if (!cleanedMessageContent.trim().length) return
|
||||
|
||||
const updatedThread: Thread = {
|
||||
...thread,
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user