mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-27 08:21:30 +00:00
fix: preserved zero values in chat settings inputs and textareas by switching to nullish coalescing for field values and default placeholders (#16312)
This commit is contained in:
Binary file not shown.
@@ -30,9 +30,9 @@
|
|||||||
|
|
||||||
<Input
|
<Input
|
||||||
id={field.key}
|
id={field.key}
|
||||||
value={String(localConfig[field.key] || '')}
|
value={String(localConfig[field.key] ?? '')}
|
||||||
onchange={(e) => onConfigChange(field.key, e.currentTarget.value)}
|
onchange={(e) => onConfigChange(field.key, e.currentTarget.value)}
|
||||||
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] || 'none'}`}
|
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] ?? 'none'}`}
|
||||||
class={isMobile ? 'w-full' : 'max-w-md'}
|
class={isMobile ? 'w-full' : 'max-w-md'}
|
||||||
/>
|
/>
|
||||||
{#if field.help || SETTING_CONFIG_INFO[field.key]}
|
{#if field.help || SETTING_CONFIG_INFO[field.key]}
|
||||||
@@ -47,9 +47,9 @@
|
|||||||
|
|
||||||
<Textarea
|
<Textarea
|
||||||
id={field.key}
|
id={field.key}
|
||||||
value={String(localConfig[field.key] || '')}
|
value={String(localConfig[field.key] ?? '')}
|
||||||
onchange={(e) => onConfigChange(field.key, e.currentTarget.value)}
|
onchange={(e) => onConfigChange(field.key, e.currentTarget.value)}
|
||||||
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] || 'none'}`}
|
placeholder={`Default: ${SETTING_CONFIG_DEFAULT[field.key] ?? 'none'}`}
|
||||||
class={isMobile ? 'min-h-[100px] w-full' : 'min-h-[100px] max-w-2xl'}
|
class={isMobile ? 'min-h-[100px] w-full' : 'min-h-[100px] max-w-2xl'}
|
||||||
/>
|
/>
|
||||||
{#if field.help || SETTING_CONFIG_INFO[field.key]}
|
{#if field.help || SETTING_CONFIG_INFO[field.key]}
|
||||||
|
|||||||
Reference in New Issue
Block a user