Skip to content

Commit

Permalink
Fixed: issue when the action throws an error instantly resulting in l…
Browse files Browse the repository at this point in the history
…oader not being dismissed(#319)
  • Loading branch information
ymaheshwari1 committed Feb 21, 2024
1 parent cc37abb commit f820bff
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ export default defineComponent({
if (this.loader) {
this.loader.dismiss();
this.loader = null as any;
} else {
// Added this else case as there are some scenarios in which the loader is not created and before that the dismissLoader gets called, resulting in the loader not getting dismissed
// So checking that when the loader is not found then try dismissing the loader again after 3 secs.
// The above case appears when directly hitting the shipment detail page and then the receive shipment api throws error
// TODO: need to find a more better approach to dismiss the loader in such case
setTimeout(() => {
if (this.loader) {
this.dismissLoader();
}
}, 3000)
}
},
async unauthorized() {
Expand Down

0 comments on commit f820bff

Please sign in to comment.