From 8811567a169039d09b309871b7e31f3b785ccd75 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Tue, 28 Mar 2023 18:39:15 +0530 Subject: [PATCH] fix progress counter increasing of failed files --- src/services/exportService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/exportService.ts b/src/services/exportService.ts index 60dbfb2ad..36f7a6ea2 100644 --- a/src/services/exportService.ts +++ b/src/services/exportService.ts @@ -273,8 +273,8 @@ class ExportService { } this.stopExport = false; this.electronAPIs.sendNotification(t('EXPORT_NOTIFICATION.START')); - - for (const [index, file] of files.entries()) { + let success = 0; + for (const file of files) { if (this.stopExport) { break; } @@ -296,7 +296,8 @@ class ExportService { file, RecordType.SUCCESS ); - updateProgress({ current: index + 1, total: files.length }); + success++; + updateProgress({ current: success, total: files.length }); } catch (e) { logError(e, 'export failed for a file'); if (