show progress view when user clicks on watch modal spinner
This commit is contained in:
parent
1d9bc49909
commit
fd51318ce6
|
@ -57,7 +57,7 @@ function WatchModal({
|
|||
|
||||
const handleSyncProgressClick = () => {
|
||||
if (watchService.isUploadRunning) {
|
||||
// show progress view
|
||||
watchService.showProgressView();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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<number, number>());
|
||||
setPercentComplete(0);
|
||||
props.closeCollectionSelector();
|
||||
setProgressView(true);
|
||||
!watchService.isUploadRunning && setProgressView(true); // don't show progress view if upload triggered by watch service
|
||||
};
|
||||
|
||||
const resumeDesktopUpload = async (
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue