diff --git a/renderer/src/components/Sync/Gitea/GiteaFileBrowser.js b/renderer/src/components/Sync/Gitea/GiteaFileBrowser.js index 5463b3d06..a8aa7c69d 100644 --- a/renderer/src/components/Sync/Gitea/GiteaFileBrowser.js +++ b/renderer/src/components/Sync/Gitea/GiteaFileBrowser.js @@ -161,7 +161,7 @@ const GiteaFileBrowser = ({ changeRepo }) => { title={`${repo?.name} (${repo.name.split('-').pop().replaceAll('_', ' ')})`} lastSync={undefined} selected - isUpload={selectedGiteaProject?.repo?.name === repo?.name && syncProgress.syncStarted} + isUpload={selectedGiteaProject?.repo?.name === repo?.name && syncProgress.syncStarted && syncProgress.syncType === 'syncFrom'} uploadPercentage={(syncProgress.completedFiles * 100) / syncProgress.totalFiles} />
diff --git a/renderer/src/components/Sync/Gitea/SyncFromGitea.js b/renderer/src/components/Sync/Gitea/SyncFromGitea.js index c495618da..f2ccb2ad3 100644 --- a/renderer/src/components/Sync/Gitea/SyncFromGitea.js +++ b/renderer/src/components/Sync/Gitea/SyncFromGitea.js @@ -15,6 +15,7 @@ export async function downloadFromGitea(repo, auth, setSyncProgress, notifyStatu setSyncProgress((prev) => ({ ...prev, syncStarted: true, + syncType: 'syncFrom', totalFiles: 6, completedFiles: 1, })); @@ -79,6 +80,7 @@ export async function downloadFromGitea(repo, auth, setSyncProgress, notifyStatu } finally { setSyncProgress({ syncStarted: false, + syncType: null, totalFiles: 0, completedFiles: 0, }); diff --git a/renderer/src/components/Sync/Scribe/ProjectFileBrowser.js b/renderer/src/components/Sync/Scribe/ProjectFileBrowser.js index b6976f836..6f87b3cbd 100644 --- a/renderer/src/components/Sync/Scribe/ProjectFileBrowser.js +++ b/renderer/src/components/Sync/Scribe/ProjectFileBrowser.js @@ -52,7 +52,7 @@ export default function ProjectFileBrowser() { lastSync={projectMeta?.lastSync} // selected={selectedAgProject?.projectName === projectMeta?.identification?.name?.en} selected={selectedAgProject?.projectId === Object.keys(projectMeta?.identification.primary.scribe)[0]} - isUpload={selectedAgProject?.projectName === projectMeta?.identification?.name?.en && syncProgress.syncStarted} + isUpload={selectedAgProject?.projectName === projectMeta?.identification?.name?.en && syncProgress.syncStarted && syncProgress.syncType === 'syncTo'} uploadPercentage={(syncProgress.completedFiles * 100) / syncProgress.totalFiles} />
diff --git a/renderer/src/components/Sync/Scribe/SyncToGitea.js b/renderer/src/components/Sync/Scribe/SyncToGitea.js index 8e65cb594..c3d6e572b 100644 --- a/renderer/src/components/Sync/Scribe/SyncToGitea.js +++ b/renderer/src/components/Sync/Scribe/SyncToGitea.js @@ -35,7 +35,7 @@ export async function uploadToGitea(projectDataAg, auth, setSyncProgress, notify if (!checkInit || !checkForRepo?.id) { setSyncProgress((prev) => ({ - ...prev, syncStarted: true, completedFiles: 1, totalFiles: 6, + ...prev, syncStarted: true, syncType: 'syncTo', completedFiles: 1, totalFiles: 6, })); let projectInitialized; if (!checkInit) { @@ -62,7 +62,7 @@ export async function uploadToGitea(projectDataAg, auth, setSyncProgress, notify } } else { setSyncProgress((prev) => ({ - ...prev, syncStarted: true, completedFiles: 1, totalFiles: 3, + ...prev, syncStarted: true, syncType: 'syncTo', completedFiles: 1, totalFiles: 3, })); // const repoOwner = await getRepoOwner(fs, projectsMetaPath); const commitStatus = await commitChanges(fs, projectsMetaPath, { email: auth.user.email, username: auth.user.username }, 'Added from scribe'); @@ -121,7 +121,7 @@ export async function uploadToGitea(projectDataAg, auth, setSyncProgress, notify throw new Error(err?.message || err); } finally { setSyncProgress((prev) => ({ - ...prev, syncStarted: false, completedFiles: 0, totalFiles: 0, + ...prev, syncStarted: false, syncType: null, completedFiles: 0, totalFiles: 0, })); } }); diff --git a/renderer/src/components/Sync/hooks/useSync.js b/renderer/src/components/Sync/hooks/useSync.js index 5300854c1..921b82eb2 100644 --- a/renderer/src/components/Sync/hooks/useSync.js +++ b/renderer/src/components/Sync/hooks/useSync.js @@ -21,6 +21,7 @@ function useSync() { }); const [syncProgress, setSyncProgress] = useState({ syncStarted: false, + syncType: null, totalFiles: 0, completedFiles: 0, });