Remove linkage
This commit is contained in:
parent
105157c164
commit
e217635a1b
2 changed files with 11 additions and 10 deletions
|
@ -429,6 +429,12 @@ class UploadManager {
|
|||
}
|
||||
}
|
||||
|
||||
private abortIfCancelled = () => {
|
||||
if (uploadCancelService.isUploadCancelationRequested()) {
|
||||
throw Error(CustomError.UPLOAD_CANCELLED);
|
||||
}
|
||||
};
|
||||
|
||||
private async parseMetadataJSONFiles(metadataFiles: FileWithCollection2[]) {
|
||||
try {
|
||||
log.info(`parseMetadataJSONFiles function executed `);
|
||||
|
@ -436,12 +442,9 @@ class UploadManager {
|
|||
this.uiService.reset(metadataFiles.length);
|
||||
|
||||
for (const { file, collectionID } of metadataFiles) {
|
||||
this.abortIfCancelled();
|
||||
const name = getFileName(file);
|
||||
try {
|
||||
if (uploadCancelService.isUploadCancelationRequested()) {
|
||||
throw Error(CustomError.UPLOAD_CANCELLED);
|
||||
}
|
||||
|
||||
log.info(`parsing metadata json file ${name}`);
|
||||
|
||||
const metadataJSON =
|
||||
|
@ -523,6 +526,9 @@ class UploadManager {
|
|||
this.parsedMetadataJSONMap,
|
||||
this.uploaderName,
|
||||
this.isCFUploadProxyDisabled,
|
||||
() => {
|
||||
this.abortIfCancelled();
|
||||
},
|
||||
(
|
||||
fileLocalID: number,
|
||||
percentPerPart?: number,
|
||||
|
|
|
@ -58,7 +58,6 @@ import {
|
|||
generateThumbnailNative,
|
||||
generateThumbnailWeb,
|
||||
} from "./thumbnail";
|
||||
import uploadCancelService from "./uploadCancelService";
|
||||
import UploadHttpClient from "./uploadHttpClient";
|
||||
|
||||
/** Upload files to cloud storage */
|
||||
|
@ -168,16 +167,12 @@ export const uploader = async (
|
|||
parsedMetadataJSONMap: Map<string, ParsedMetadataJSON>,
|
||||
uploaderName: string,
|
||||
isCFUploadProxyDisabled: boolean,
|
||||
abortIfCancelled: () => void,
|
||||
makeProgessTracker: MakeProgressTracker,
|
||||
): Promise<UploadResponse> => {
|
||||
const name = assetName(fileWithCollection);
|
||||
log.info(`Uploading ${name}`);
|
||||
|
||||
const abortIfCancelled = () => {
|
||||
if (uploadCancelService.isUploadCancelationRequested())
|
||||
throw Error(CustomError.UPLOAD_CANCELLED);
|
||||
};
|
||||
|
||||
const { collection, localID, ...uploadAsset2 } = fileWithCollection;
|
||||
/* TODO(MR): ElectronFile changes */
|
||||
const uploadAsset = uploadAsset2 as UploadAsset;
|
||||
|
|
Loading…
Reference in a new issue