From f3dba0ce55d1af4665241ab1c97528d4925e082a Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Mon, 9 Oct 2023 11:30:25 +0530 Subject: [PATCH] Improved: making async await shipping function call (#244) --- src/views/Completed.vue | 4 ++-- src/views/ShippingPopover.vue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/views/Completed.vue b/src/views/Completed.vue index 03edb2d1..ff4634a4 100644 --- a/src/views/Completed.vue +++ b/src/views/Completed.vue @@ -388,12 +388,12 @@ export default defineComponent({ showBackdrop: false, }); - popover.onDidDismiss().then((result) => { + popover.onDidDismiss().then(async(result) => { const selectedMethod = result.data.selectedMethod // Calls method which is clicked on the popover, functions name returns when popover dismiss. if(typeof(this[selectedMethod]) === 'function') { - (this as any)[selectedMethod](order); + await (this as any)[selectedMethod](order); } }) diff --git a/src/views/ShippingPopover.vue b/src/views/ShippingPopover.vue index 63d0a5ad..56d9f28f 100644 --- a/src/views/ShippingPopover.vue +++ b/src/views/ShippingPopover.vue @@ -10,7 +10,7 @@ {{ $t("Unpack") }} - + {{ $t("Shipping label error") }} @@ -36,9 +36,9 @@ export default defineComponent({ }, props: ['hasPackedShipments', 'order'], methods: { - closeModal(eventName: string) { + closeModal(selectedMethod: string) { // Sending function name to be called after popover dismiss. - popoverController.dismiss({selectedMethod: eventName}) + popoverController.dismiss({selectedMethod: selectedMethod}) } }, setup() {