MOBILE-2890 calendar: Confirm delete reminder

main
Albert Gasset 2019-10-01 15:31:52 +02:00
parent 9884da00d4
commit 922429e0d1
1 changed files with 15 additions and 3 deletions

View File

@ -344,10 +344,22 @@ export class AddonCalendarEventPage implements OnDestroy {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
const message = this.translate.instant('core.areyousure');
const okText = this.translate.instant('core.delete');
this.domUtils.showConfirm(message, undefined, okText).then(() => {
const modal = this.domUtils.showModalLoading('core.deleting', true);
this.calendarProvider.deleteEventReminder(id).then(() => { this.calendarProvider.deleteEventReminder(id).then(() => {
this.calendarProvider.getEventReminders(this.eventId).then((reminders) => { this.calendarProvider.getEventReminders(this.eventId).then((reminders) => {
this.reminders = reminders; this.reminders = reminders;
}); });
}).catch((error) => {
this.domUtils.showErrorModalDefault(error, 'Error deleting reminder');
}).finally(() => {
modal.dismiss();
});
}).catch(() => {
// Cancelled.
}); });
} }