From d5edccdb71aa3c5f1d04d67a1a1c26c42aa12d49 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 13 May 2025 09:39:01 +0530 Subject: [PATCH] fix: unsafe mutations. More info: Mutations are fine in normal `async/awaits` but not allowed on functions that are called from svelte context using `{#await}` on Svelte5 afaik. They can, however be updated from other async functions inside the one that is called, like we did here in this commit for `$repositories` updates. --- src/lib/components/git/repositories.svelte | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/components/git/repositories.svelte b/src/lib/components/git/repositories.svelte index ca2842794..112a5d350 100644 --- a/src/lib/components/git/repositories.svelte +++ b/src/lib/components/git/repositories.svelte @@ -42,7 +42,7 @@ } = $props(); let search = $state(''); - let selectedInstallation = $state(null); + let selectedInstallation = null; async function loadInstallations() { if (installationList) { @@ -76,9 +76,6 @@ await fetchRepos(installationId, search); } - $repositories.search = search; - $repositories.installationId = installationId; - if ($repositories.repositories.length && action === 'select') { selectedRepository = $repositories.repositories[0].id; $repository = $repositories.repositories[0]; @@ -108,6 +105,9 @@ )) as unknown as Models.ProviderRepositoryFrameworkList ).frameworkProviderRepositories; } + + $repositories.search = search; + $repositories.installationId = installationId; }