Skip to content

Commit

Permalink
Update Select
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlie Kapsiak committed Oct 17, 2024
1 parent 0bb87fe commit 70e48af
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/routes/BarcodeScanner.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,23 @@
<video bind:this={video_element} id="video" width="300" height="200" style="border: 1px solid gray"></video>
</div>

<select bind:value={selected_device_id} on:change={onSelectDevice}>
{#await promise}
<option value={null}> Loading Available Video Devices... </option>
{:then devices}
{#if devices.length > 0}
{#each devices as device}
<option value={device.id}>
{device.label}
</option>
{/each}
{/if}
<div class="select">
<select bind:value={selected_device_id} on:change={onSelectDevice}>
{#await promise}
<option value={null}> Loading Available Video Devices... </option>
{:then devices}
{#if devices.length > 0}
{#each devices as device}
<option value={device.id}>
{device.label}
</option>
{/each}
{/if}
{:catch someError}
System error: {someError.message}.
{/await}
</select>

System error: {someError.message}.
{/await}
</select>
</div>
{#if selected_device_id !== null}
<button on:click={toggle}> {(isRunning())? "Stop" : "Start"} Decode</button>
{/if}
Expand Down

0 comments on commit 70e48af

Please sign in to comment.