fix(app): correctly handle false value in settings
All checks were successful
🚀 Release / release (push) Successful in 4m30s

This caused a bug where random seed could not be false.
This commit is contained in:
2026-02-03 22:46:43 +01:00
parent 91866b4e9a
commit 381f784775

View File

@@ -98,7 +98,7 @@
&& typeof internalValue === 'number' && typeof internalValue === 'number'
) { ) {
value[key] = node?.options?.[internalValue]; value[key] = node?.options?.[internalValue];
} else if (internalValue) { } else if (internalValue !== undefined) {
value[key] = internalValue; value[key] = internalValue;
} }
}); });
@@ -124,7 +124,6 @@
{#if key && isNodeInput(type?.[key])} {#if key && isNodeInput(type?.[key])}
{@const inputType = type[key]} {@const inputType = type[key]}
<!-- Leaf input -->
<div class="input input-{inputType.type}" class:first-level={depth === 1}> <div class="input input-{inputType.type}" class:first-level={depth === 1}>
{#if inputType.type === 'button'} {#if inputType.type === 'button'}
<button onclick={handleClick}> <button onclick={handleClick}>
@@ -138,7 +137,6 @@
{/if} {/if}
</div> </div>
{:else if depth === 0} {:else if depth === 0}
<!-- Root: iterate over top-level keys -->
{#each Object.keys(type ?? {}).filter((k) => k !== 'title') as childKey (childKey)} {#each Object.keys(type ?? {}).filter((k) => k !== 'title') as childKey (childKey)}
<NestedSettings <NestedSettings
id={`${id}.${childKey}`} id={`${id}.${childKey}`}
@@ -150,7 +148,6 @@
{/each} {/each}
<hr /> <hr />
{:else if key && type?.[key]} {:else if key && type?.[key]}
<!-- Group -->
{#if depth > 0} {#if depth > 0}
<hr /> <hr />
{/if} {/if}