diff --git a/src/services/exportService.ts b/src/services/exportService.ts index 3aade4024..c423b19c8 100644 --- a/src/services/exportService.ts +++ b/src/services/exportService.ts @@ -269,6 +269,17 @@ class ExportService { exportRecord.exportedCollectionPaths ); const collectionIDNameMap = getCollectionNameMap(collections); + + const removedFileUIDs = getDeletedExportedFiles( + userPersonalFiles, + exportRecord + ); + + if (removedFileUIDs?.length > 0) { + addLogLine(`removing ${removedFileUIDs.length} files`); + await this.fileRemover(removedFileUIDs, exportDir); + } + const renamedCollections = getRenamedCollections( userCollections, exportRecord @@ -300,15 +311,6 @@ class ExportService { exportDir ); } - const removedFileUIDs = getDeletedExportedFiles( - userPersonalFiles, - exportRecord - ); - - if (removedFileUIDs?.length > 0) { - addLogLine(`removing ${removedFileUIDs.length} files`); - await this.fileRemover(removedFileUIDs, exportDir); - } const deletedExportedCollections = getDeletedExportedCollections( userCollections,