allow resumable upload for zip too
This commit is contained in:
parent
332fdf5916
commit
a212d83492
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue