From db64cb304732bc3f5943d79218e9466a0d73bb9d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 29 Dec 2025 17:05:10 -0600 Subject: [PATCH] Refetch autosync after creating git repo --- src/components/git-sync/steps/ConfigureRepoStep.tsx | 8 ++++++-- src/hooks/useGitAutosync.ts | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/git-sync/steps/ConfigureRepoStep.tsx b/src/components/git-sync/steps/ConfigureRepoStep.tsx index bd6c6a36..868d54bd 100644 --- a/src/components/git-sync/steps/ConfigureRepoStep.tsx +++ b/src/components/git-sync/steps/ConfigureRepoStep.tsx @@ -18,6 +18,7 @@ import { nip19 } from 'nostr-tools'; import type { ConfigureRepoStepProps } from '../types'; import type { NostrEvent } from '@nostrify/nostrify'; import { NostrURI } from '@/lib/NostrURI'; +import { useGitAutosync } from '@/hooks/useGitAutosync'; export function ConfigureRepoStep({ projectId, @@ -33,7 +34,11 @@ export function ConfigureRepoStep({ const { user } = useCurrentUser(); const { git } = useGit(); const { projectsPath } = useFSPaths(); + + const dir = `${projectsPath}/${projectId}`; + const { data: gitStatus, refetch: refetchGitStatus } = useGitStatus(projectId); + const { refetch: refetchAutosync } = useGitAutosync(dir); const { nostr } = useNostr(); const { mutateAsync: publishEvent } = useNostrPublish(); const { fs } = useFS(); @@ -44,8 +49,6 @@ export function ConfigureRepoStep({ setError(null); try { - const dir = `${projectsPath}/${projectId}`; - if (selectedProvider.id === 'nostr') { if (!user) { throw new Error('User is not logged in'); @@ -201,6 +204,7 @@ export function ConfigureRepoStep({ }); // Refresh git status before showing success + await refetchAutosync(); await refetchGitStatus(); // Show success state onSuccess(); diff --git a/src/hooks/useGitAutosync.ts b/src/hooks/useGitAutosync.ts index 5c65bda1..98a731b4 100644 --- a/src/hooks/useGitAutosync.ts +++ b/src/hooks/useGitAutosync.ts @@ -53,5 +53,6 @@ export function useGitAutosync(dir: string | undefined) { isLoading: query.isLoading, setAutosync: mutation.mutateAsync, isUpdating: mutation.isPending, + refetch: query.refetch, }; }