Skip to content

Commit 0709395

Browse files
fix: preserved zero values in chat settings inputs and textareas by switching to nullish coalescing for field values and default placeholders
1 parent e6d65fb commit 0709395

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsFields.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
<Input
3232
id={field.key}
33-
value={String(localConfig[field.key] || '')}
33+
value={String(localConfig[field.key] ?? '')}
3434
onchange={(e) => onConfigChange(field.key, e.currentTarget.value)}
35-
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] || 'none'}`}
35+
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] ?? 'none'}`}
3636
class={isMobile ? 'w-full' : 'max-w-md'}
3737
/>
3838
{#if field.help || SETTING_CONFIG_INFO[field.key]}
@@ -47,9 +47,9 @@
4747

4848
<Textarea
4949
id={field.key}
50-
value={String(localConfig[field.key] || '')}
50+
value={String(localConfig[field.key] ?? '')}
5151
onchange={(e) => onConfigChange(field.key, e.currentTarget.value)}
52-
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] || 'none'}`}
52+
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] ?? 'none'}`}
5353
class={isMobile ? 'min-h-[100px] w-full' : 'min-h-[100px] max-w-2xl'}
5454
/>
5555
{#if field.help || SETTING_CONFIG_INFO[field.key]}

0 commit comments

Comments
 (0)