From d3e3ffffd24467401c8144890516ee0feab72bc7 Mon Sep 17 00:00:00 2001 From: Caleb Owens Date: Thu, 15 Aug 2024 19:00:44 +0200 Subject: [PATCH] fix githost factory initialization --- apps/desktop/src/routes/[projectId]/+layout.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/routes/[projectId]/+layout.svelte b/apps/desktop/src/routes/[projectId]/+layout.svelte index 62bcd9827..e8e2be661 100644 --- a/apps/desktop/src/routes/[projectId]/+layout.svelte +++ b/apps/desktop/src/routes/[projectId]/+layout.svelte @@ -76,7 +76,7 @@ const showHistoryView = persisted(false, 'showHistoryView'); const octokit = $derived(accessToken ? octokitFromAccessToken(accessToken) : undefined); - const gitHostFactory = $derived(octokit ? new DefaultGitHostFactory(octokit) : undefined); + const gitHostFactory = $derived(new DefaultGitHostFactory(octokit)); const repoInfo = $derived(remoteUrl ? parseRemoteUrl(remoteUrl) : undefined); const forkInfo = $derived(forkUrl && forkUrl !== remoteUrl ? parseRemoteUrl(forkUrl) : undefined); const baseBranchName = $derived($baseBranch?.shortName); @@ -118,8 +118,9 @@ $effect.pre(() => { const gitHost = repoInfo && baseBranchName - ? gitHostFactory?.build(repoInfo, baseBranchName, forkInfo) + ? gitHostFactory.build(repoInfo, baseBranchName, forkInfo) : undefined; + const ghListService = gitHost?.listService(); listServiceStore.set(ghListService);