Skip to content

Commit

Permalink
fix: directions submit loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Yizack committed Mar 13, 2024
1 parent cba0470 commit 15ebd52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pages/app/direcciones.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export default {
}
},
async getDirections () {
this.submit = true;
if (CAPACITOR.isOnline()) {
if (!this.directions.routes.length) {
if (!this.apiKey) {
Expand Down Expand Up @@ -242,15 +243,14 @@ export default {
provideRouteAlternatives: true,
language: t("lang_code")
};
this.submit = true;
directionsService.route(options, (response, status) => {
if (status === DirectionsStatus.OK) {
this.directions = response;
}
else if (status === DirectionsStatus.ZERO_RESULTS) {
CAPACITOR.showToast(t("no_direcciones"));
}
this.submit = false;
});
}
catch {
Expand All @@ -260,6 +260,7 @@ export default {
else {
CAPACITOR.showToast(t("error"));
}
this.submit = false;
}
else {
this.form.origin = "";
Expand Down

0 comments on commit 15ebd52

Please sign in to comment.