Skip to content

Commit

Permalink
Merge pull request #927 from ymaheshwari1/#901
Browse files Browse the repository at this point in the history
Fixed: spinner not displayed when generating shipping label for transfer shipment(#901)
  • Loading branch information
ymaheshwari1 authored Jan 29, 2025
2 parents e084109 + 7024a6b commit b62e367
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/views/TransferShipmentReview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
<ion-item>
<ion-label>{{ currentShipment.totalQuantityPicked }} {{ translate("items picked") }}</ion-label>
<ion-button expand="block" fill="outline" @click="generateShippingLabel(currentShipment)">
<ion-icon slot="start" :icon="documentTextOutline" />{{ currentShipment.trackingCode ? translate("Regenerate Shipping Label") : translate("Generate shipping label") }}
<ion-spinner color="primary" slot="start" v-if="currentShipment.isGeneratingShippingLabel" name="crescent" />
<ion-icon slot="start" :icon="documentTextOutline" />
{{ currentShipment.trackingCode ? translate("Regenerate Shipping Label") : translate("Generate shipping label") }}
<ion-spinner color="primary" slot="end" v-if="isGeneratingShippingLabel" name="crescent" />
</ion-button>
</ion-item>
<ion-item>
Expand Down Expand Up @@ -159,7 +160,8 @@
isShipped: false,
trackingCode: '',
shipmentItems: [] as any,
showLabelError: false
showLabelError: false,
isGeneratingShippingLabel: false
}
},
computed: {
Expand Down Expand Up @@ -197,12 +199,12 @@
// if the request to print shipping label is not yet completed, then clicking multiple times on the button
// should not do anything
if (currentShipment.isGeneratingShippingLabel) {
if (this.isGeneratingShippingLabel) {
return;
}
await this.store.dispatch('transferorder/fetchTransferShipmentDetail', { shipmentId: this.$route.params.shipmentId })
currentShipment.isGeneratingShippingLabel = true;
this.isGeneratingShippingLabel = true;
let shippingLabelPdfUrls = this.currentShipment.shipmentPackages
?.filter((shipmentPackage: any) => shipmentPackage.labelPdfUrl)
.map((shipmentPackage: any) => shipmentPackage.labelPdfUrl);
Expand Down Expand Up @@ -232,7 +234,7 @@
await OrderService.printShippingLabel([this.currentShipment.shipmentId], shippingLabelPdfUrls)
}
currentShipment.isGeneratingShippingLabel = false;
this.isGeneratingShippingLabel = false;
},
async transferShipmentActionsPopover(ev: Event) {
const popover = await popoverController.create({
Expand Down

0 comments on commit b62e367

Please sign in to comment.