From a2bbf4474d4a801ece1cb52d57f61f55ecfe2ebb Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 6 Nov 2024 13:52:59 +0100 Subject: [PATCH 1/2] fix(InvoiceOutGlobal): parallelism --- src/pages/InvoiceOut/InvoiceOutGlobalForm.vue | 7 ++-- src/stores/invoiceOutGlobal.js | 37 +++++++++---------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue index 5bcb21001..e85f1f44c 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobalForm.vue @@ -13,7 +13,7 @@ const { t } = useI18n(); const invoiceOutGlobalStore = useInvoiceOutGlobalStore(); // invoiceOutGlobalStore state and getters -const { initialDataLoading, formInitialData, invoicing, status } = +const { initialDataLoading, formInitialData, status } = storeToRefs(invoiceOutGlobalStore); // invoiceOutGlobalStore actions @@ -151,9 +151,8 @@ onMounted(async () => { rounded /> - { dense /> = 400 && err?.response?.status < 500) { @@ -205,13 +202,16 @@ export const useInvoiceOutGlobalStore = defineStore({ return; } else { this.invoicing = false; - this.status = 'done'; notify( 'invoiceOut.globalInvoices.errors.criticalInvoiceError', 'negative' ); throw new Error('Critical invoicing error, process stopped'); } + } finally { + this.addressIndex++; + if (this.status != 'stopping') + await this.invoiceClient(formData, this.addressIndex); } }, @@ -234,7 +234,6 @@ export const useInvoiceOutGlobalStore = defineStore({ handleError(err) { this.invoicing = false; - this.status = null; throw err; }, @@ -279,7 +278,7 @@ export const useInvoiceOutGlobalStore = defineStore({ return 0; } let porcentaje = (state.addressIndex / this.getNAddresses) * 100; - return porcentaje; + return porcentaje?.toFixed(2); }, getAddressNumber(state) { return state.addressIndex; From ead241e7daa826608dfe522349f4691a06dbc2c9 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 6 Nov 2024 13:53:58 +0100 Subject: [PATCH 2/2] chore: remove console.log --- src/stores/invoiceOutGlobal.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/stores/invoiceOutGlobal.js b/src/stores/invoiceOutGlobal.js index b17f41564..35f834f3d 100644 --- a/src/stores/invoiceOutGlobal.js +++ b/src/stores/invoiceOutGlobal.js @@ -179,7 +179,6 @@ export const useInvoiceOutGlobalStore = defineStore({ this.invoicing = false; return; } - console.log('address: ', address); try { const params = { clientId: address.clientId,