minor fixes
This commit is contained in:
parent
1669d1a8b4
commit
dc65cbf7d8
|
@ -57,7 +57,6 @@ interface Props {
|
|||
setCollectionSelectorAttributes: SetCollectionSelectorAttributes;
|
||||
setCollectionNamerAttributes: SetCollectionNamerAttributes;
|
||||
setLoading: SetLoading;
|
||||
uploadInProgress: boolean;
|
||||
setUploadInProgress: (value: boolean) => void;
|
||||
showCollectionSelector: () => void;
|
||||
setFiles: SetFiles;
|
||||
|
@ -175,7 +174,7 @@ export default function Uploader(props: Props) {
|
|||
webFiles?.length > 0 ||
|
||||
appContext.sharedFiles?.length > 0
|
||||
) {
|
||||
if (props.uploadInProgress) {
|
||||
if (uploadManager.isUploadRunning()) {
|
||||
if (watchFolderService.isUploadRunning()) {
|
||||
// pause watch folder service on user upload
|
||||
watchFolderService.pauseRunningSync();
|
||||
|
@ -383,7 +382,7 @@ export default function Uploader(props: Props) {
|
|||
filesWithCollectionToUploadIn,
|
||||
collections
|
||||
);
|
||||
} else if (watchFolderService.isServicePaused()) {
|
||||
} else if (watchFolderService.isSyncPaused()) {
|
||||
// resume the service after user upload is done
|
||||
watchFolderService.resumePausedSync();
|
||||
}
|
||||
|
|
|
@ -668,7 +668,6 @@ export default function Gallery() {
|
|||
)}
|
||||
setLoading={setBlockingLoad}
|
||||
setCollectionNamerAttributes={setCollectionNamerAttributes}
|
||||
uploadInProgress={uploadInProgress}
|
||||
setUploadInProgress={setUploadInProgress}
|
||||
setFiles={setFiles}
|
||||
setCollections={setCollections}
|
||||
|
|
|
@ -67,6 +67,10 @@ class UploadManager {
|
|||
this.setFiles = setFiles;
|
||||
}
|
||||
|
||||
public isUploadRunning() {
|
||||
return this.uploadInProgress;
|
||||
}
|
||||
|
||||
private resetState() {
|
||||
this.filesToBeUploaded = [];
|
||||
this.remainingFiles = [];
|
||||
|
@ -435,16 +439,7 @@ class UploadManager {
|
|||
this.failedFiles.push(fileWithCollection);
|
||||
break;
|
||||
case UPLOAD_RESULT.ALREADY_UPLOADED:
|
||||
if (isElectron()) {
|
||||
await watchFolderService.onFileUpload(
|
||||
fileWithCollection,
|
||||
uploadedFile
|
||||
);
|
||||
}
|
||||
await this.updateFilePaths(
|
||||
uploadedFile,
|
||||
fileWithCollection
|
||||
);
|
||||
decryptedFile = uploadedFile;
|
||||
break;
|
||||
case UPLOAD_RESULT.ADDED_SYMLINK:
|
||||
decryptedFile = uploadedFile;
|
||||
|
@ -474,6 +469,10 @@ class UploadManager {
|
|||
) {
|
||||
this.updateExistingFiles(decryptedFile);
|
||||
await this.updateFilePaths(decryptedFile, fileWithCollection);
|
||||
await this.watchFolderCallback(
|
||||
fileWithCollection,
|
||||
uploadedFile
|
||||
);
|
||||
}
|
||||
return fileUploadResult;
|
||||
} catch (e) {
|
||||
|
|
|
@ -45,7 +45,7 @@ class watchFolderService {
|
|||
return this.uploadRunning;
|
||||
}
|
||||
|
||||
isServicePaused() {
|
||||
isSyncPaused() {
|
||||
return this.isPaused;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue