fix(launcher): guard hash_prefix_length select on native_device existence

native_device can be undefined during initial load (before device config
is fetched). The select bind:value was doing a hard property access that
threw a TypeError crash when native_device was null/undefined. Wrapped
in {#if $ae_loc.native_device} to defer rendering until it's available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-03-04 18:34:19 -05:00
parent 0179471113
commit 4aa1c2485d

View File

@@ -131,16 +131,20 @@
>
<div class="flex items-center justify-between px-1">
<span class="text-[9px]">Hash Prefix Length</span>
<select
bind:value={
$ae_loc.native_device.hash_prefix_length
}
class="select select-sm h-6 py-0 text-[10px] w-16 preset-tonal-surface"
>
<option value={1}>1 char</option>
<option value={2}>2 chars</option>
<option value={3}>3 chars</option>
</select>
{#if $ae_loc.native_device}
<select
bind:value={
$ae_loc.native_device.hash_prefix_length
}
class="select select-sm h-6 py-0 text-[10px] w-16 preset-tonal-surface"
>
<option value={1}>1 char</option>
<option value={2}>2 chars</option>
<option value={3}>3 chars</option>
</select>
{:else}
<span class="text-[9px] opacity-50 italic">loading…</span>
{/if}
</div>
<p class="text-[8px] opacity-40 italic mt-1">
* Prefix change requires a full app reload to take