Hi,
One of my actionsheet handler creates an alert, but the actionsheet doesn’t close after the alert shows up. It’s a simple alert with an “OK” button. The use case is, I’m using the action sheet to post to an API endpoint when its clicked. When the API endpoint returns, I show an Alert with a “Thank you message”.
Preferably I’d like the ActionSheet to close even before the Alert message is shown.
Any idea how I can close the ActionSheet?
Here’s my implementation:
let actionSheet = ActionSheet.create({
buttons: [
{
text: 'Report Abuse',
role: 'destructive',
handler: () => {
let params = { resource_type: this.resourceType, resource_id: this.resourceId }
this.authHttp.post(this.REPORT_URL, JSON.stringify(params)).toPromise()
.then(res => {
AlertService.alert({ nav: this.nav, message: "Thank you for your report. The administrators have been notified.", title: 'Thank You' })
});
}
}, {
text: 'Cancel',
role: 'cancel',
handler: () => {
return true;
}
}
]
});
this.nav.present(actionSheet);