mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Refetch autosync after creating git repo
This commit is contained in:
2 files changed
+7
-2
No files matched your search
@@ -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();
|
||||
|
||||
@@ -53,5 +53,6 @@ export function useGitAutosync(dir: string | undefined) {
|
||||
isLoading: query.isLoading,
|
||||
setAutosync: mutation.mutateAsync,
|
||||
isUpdating: mutation.isPending,
|
||||
refetch: query.refetch,
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user