fix(web): coerce chat composer draft to string (input.trim crash)
The Send button's disabled={!input.trim()} threw "trim is not a function" when
input was initialized from a non-string initialDraft (a Svelte 5 prop-init edge
where a null/undefined draft reached $state). Coerce at init so the composer
state is always a string.
VERSION: 0.15.0 -> 0.15.1
This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
initialDraft?: string
|
initialDraft?: string
|
||||||
} = $props()
|
} = $props()
|
||||||
|
|
||||||
let input = $state(initialDraft)
|
let input = $state(typeof initialDraft === 'string' ? initialDraft : '')
|
||||||
let messagesEnd = $state<HTMLDivElement | null>(null)
|
let messagesEnd = $state<HTMLDivElement | null>(null)
|
||||||
let scrolledUp = $state(false)
|
let scrolledUp = $state(false)
|
||||||
let container = $state<HTMLDivElement | null>(null)
|
let container = $state<HTMLDivElement | null>(null)
|
||||||
|
|||||||
Reference in New Issue
Block a user