diff --git a/src/components/WatchModal.tsx b/src/components/WatchModal.tsx index 2f195f97d..4fd7b4cc9 100644 --- a/src/components/WatchModal.tsx +++ b/src/components/WatchModal.tsx @@ -57,7 +57,7 @@ function WatchModal({ const handleSyncProgressClick = () => { if (watchService.isUploadRunning) { - // show progress view + watchService.showProgressView(); } }; diff --git a/src/components/pages/gallery/Upload.tsx b/src/components/pages/gallery/Upload.tsx index 1ea393be4..0a1753be3 100644 --- a/src/components/pages/gallery/Upload.tsx +++ b/src/components/pages/gallery/Upload.tsx @@ -120,7 +120,8 @@ export default function Upload(props: Props) { watchService.setWatchServiceFunctions( props.setElectronFiles, setCollectionName, - props.syncWithRemote + props.syncWithRemote, + showProgressView ); watchService.init(); } @@ -131,6 +132,10 @@ export default function Upload(props: Props) { pendingDesktopUploadCollectionName.current = collectionName; }; + const showProgressView = () => { + setProgressView(true); + }; + useEffect(() => { if ( props.electronFiles?.length > 0 || @@ -185,7 +190,7 @@ export default function Upload(props: Props) { setUploadResult(new Map()); setPercentComplete(0); props.closeCollectionSelector(); - setProgressView(true); + !watchService.isUploadRunning && setProgressView(true); // don't show progress view if upload triggered by watch service }; const resumeDesktopUpload = async ( diff --git a/src/services/watchService.ts b/src/services/watchService.ts index 94ad79510..f12633bbc 100644 --- a/src/services/watchService.ts +++ b/src/services/watchService.ts @@ -42,11 +42,13 @@ class WatchService { setWatchServiceFunctions( setElectronFiles: (files: ElectronFile[]) => void, setCollectionName: (collectionName: string) => void, - syncWithRemote: () => void + syncWithRemote: () => void, + showProgressView: () => void ) { this.setElectronFiles = setElectronFiles; this.setCollectionName = setCollectionName; this.syncWithRemote = syncWithRemote; + this.showProgressView = showProgressView; } async init() {