allow resumable upload for zip too

This commit is contained in:
Abhinav 2022-04-20 14:16:13 +05:30
parent 332fdf5916
commit a212d83492
2 changed files with 2 additions and 8 deletions

View file

@ -409,7 +409,6 @@ export default function Upload(props: Props) {
files = await ImportService.showUploadDirsDialog();
} else {
files = await ImportService.showUploadZipDialog();
ImportService.setSkipUpdatePendingUploads(true);
}
props.setElectronFiles(files);

View file

@ -10,17 +10,12 @@ interface PendingUploads {
class ImportService {
ElectronAPIs: any;
private allElectronAPIsExist: boolean = false;
private skipUpdatePendingUploads = false;
constructor() {
this.ElectronAPIs = runningInBrowser() && window['ElectronAPIs'];
this.allElectronAPIsExist = !!this.ElectronAPIs?.getPendingUploads;
}
setSkipUpdatePendingUploads(skip: boolean) {
this.skipUpdatePendingUploads = skip;
}
async getElectronFilesFromGoogleZip(
zipPath: string
): Promise<ElectronFile[]> {
@ -65,7 +60,7 @@ class ImportService {
files: FileWithCollection[],
collections: Collection[]
) {
if (this.allElectronAPIsExist && !this.skipUpdatePendingUploads) {
if (this.allElectronAPIsExist) {
let collectionName: string;
/* collection being one suggest one of two things
1. Either the user has upload to a single existing collection
@ -87,7 +82,7 @@ class ImportService {
}
}
updatePendingUploads(files: FileWithCollection[]) {
if (this.allElectronAPIsExist && !this.skipUpdatePendingUploads) {
if (this.allElectronAPIsExist) {
const filePaths = [];
for (const fileWithCollection of files) {
if (fileWithCollection.isLivePhoto) {