// If the user enters text in the support question and then navigates
// without submitting first, ask if they meant to leave the page
// async ionViewCanLeave(): Promise {
// // If the support message is empty we should just navigate
// if (!this.supportMessage || this.supportMessage.trim().length === 0) {
// return true;
// }
// return new Promise((resolve: any, reject: any) => {
// const alert = await this.alertCtrl.create({
// title: ‘Leave this page?’,
// message: ‘Are you sure you want to leave this page? Your support message will not be submitted.’,
// buttons: [
// { text: ‘Stay’, handler: reject },
// { text: ‘Leave’, role: ‘cancel’, handler: resolve }
// ]
// });
// await alert.present();
// });
// }
Hi, I realise that this piece of code has been commented out from the ionic-conference-app support.ts file. I found this prompt quite useful for users in case they hit back button by mistake.
I am upgrading to ionic 4 and am wondering if someone might have solution for this.