From 9696bf59291b2592322ced7c21672e57cb1ecc86 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 16 Jun 2025 11:01:09 +0200 Subject: [PATCH 1/2] Removing await function to fix the combobox select options --- src/lib/components/git/repositories.svelte | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index b82781169..c30a07174 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -23,7 +23,7 @@ import { page } from '$app/state'; import Card from '../card.svelte'; import SkeletonRepoList from './skeletonRepoList.svelte'; - import { untrack } from 'svelte'; + import { onMount, untrack } from 'svelte'; let { action = $bindable('select'), @@ -46,6 +46,11 @@ let search = $state(''); let selectedInstallation = $state(null); let isLoadingRepositories = $state(null); + let installationsMap = $state(null); + + onMount(() => { + loadInstallations(); + }); async function loadInstallations() { if (installationList) { @@ -59,7 +64,7 @@ ) ); } - return installationList.installations; + installationsMap = installationList.installations; } else { const { installations } = await sdk .forProject(page.params.region, page.params.project) @@ -70,7 +75,7 @@ } installation.set(installations.find((entry) => entry.$id === selectedInstallation)); } - return installations; + installationsMap = installations; } } @@ -123,7 +128,7 @@ {#if hasInstallations} - {#await loadInstallations()} + {#if !installationsMap} - {:then installations} + {:else} { + ...installationsMap.map((entry) => { return { label: entry.organization, value: entry.$id @@ -160,7 +165,7 @@ } search = ''; installation.set( - installations.find((entry) => entry.$id === selectedInstallation) + installationsMap.find((entry) => entry.$id === selectedInstallation) ); isLoadingRepositories = true; @@ -174,7 +179,7 @@ bind:value={search} disabled={!search && !$repositories?.repositories?.length} /> - {/await} + {/if} {#if selectedInstallation} @@ -310,3 +315,4 @@ {:else} {/if} +hai hoi From 420d365165ed459a3d5af2c3118ebe5aa5157600 Mon Sep 17 00:00:00 2001 From: ernstmul Date: Mon, 16 Jun 2025 11:02:31 +0200 Subject: [PATCH 2/2] Remove debug --- src/lib/components/git/repositories.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index c30a07174..39f260a99 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -315,4 +315,3 @@ {:else} {/if} -hai hoi