Skip to content

Commit 98ad651

Browse files
author
Nicolas Perraut
committed
Fix app crash when trying to search product with no/degraded network connection
This fix #1
1 parent ede8412 commit 98ad651

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

app/pages/home/home.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,26 @@ export class HomePage {
4242
}
4343
},
4444
err => {
45-
this.alertController.create({
45+
let alert = this.alertController.create({
4646
title: "Erreur de recherche",
4747
subTitle: "Une erreur est survenue lors de la recherche du produit. Vérifiez votre connexion Internet et rézssayez. Infos techniques : " + err,
4848
buttons: [
4949
{
5050
text: "Réessayer",
51-
handler: this.getProduct(productCode)
51+
handler: () => {
52+
alert.dismiss().then(() => {
53+
this.getProduct(productCode);
54+
})
55+
return false;
56+
}
5257
},
5358
{
5459
text: "OK"
5560
}
5661
]
57-
}).present()
62+
});
63+
64+
alert.present();
5865
}
5966
);
6067
}

0 commit comments

Comments
 (0)