From 86cbeb9a324655126ead0ca0a5dc95f4b6d0193f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 15 Nov 2021 11:26:18 +0530 Subject: [PATCH] fix: csv import progress correction Signed-off-by: Pranav C --- .../project/spreadsheet/components/csvExportImport.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/csvExportImport.vue b/packages/nc-gui/components/project/spreadsheet/components/csvExportImport.vue index 0d5317852c..4ef6b333a0 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/csvExportImport.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/csvExportImport.vue @@ -236,9 +236,6 @@ export default { }) const data = this.parsedCsv.data for (let i = 0, progress = 0; i < data.length; i += 500) { - this.$store.commit('loader/MutMessage', `Importing data : ${progress}/${data.length}`) - this.$store.commit('loader/MutProgress', Math.round(progress && 100 * progress / data.length)) - const batchData = data.slice(i, i + 500).map(row => columnMappings.reduce((res, col) => { if (col.enabled) { res[col.destCn] = row[col.sourceCn] @@ -247,6 +244,8 @@ export default { }, {})) await api.insertBulk(batchData) progress += batchData.length + this.$store.commit('loader/MutMessage', `Importing data : ${progress}/${data.length}`) + this.$store.commit('loader/MutProgress', Math.round((100 * progress / data.length))) } this.columnMappingModal = false this.$store.commit('loader/MutClear')