diff --git a/src/components/alert/alert-component.ts b/src/components/alert/alert-component.ts index 9ed1869143..756e2c6b5b 100644 --- a/src/components/alert/alert-component.ts +++ b/src/components/alert/alert-component.ts @@ -256,9 +256,7 @@ export class AlertCmp { } if (shouldDismiss) { - this.dismiss(button.role).catch(() => { - console.debug('alert can not be dismissed'); - }); + this.dismiss(button.role); } } diff --git a/src/components/modal/modal-component.ts b/src/components/modal/modal-component.ts index abee0c4815..d9010c8a86 100644 --- a/src/components/modal/modal-component.ts +++ b/src/components/modal/modal-component.ts @@ -98,9 +98,7 @@ export class ModalCmp { const opts: NavOptions = { minClickBlockDuration: 400 }; - return this._viewCtrl.dismiss(null, 'backdrop', opts).catch(() => { - console.debug('Dismiss modal by clicking backdrop was cancelled'); - }); + return this._viewCtrl.dismiss(null, 'backdrop', opts); } } diff --git a/src/components/modal/test/basic/pages/modal-pass-data/modal-pass-data.ts b/src/components/modal/test/basic/pages/modal-pass-data/modal-pass-data.ts index 739d0e3361..1cc05090c5 100644 --- a/src/components/modal/test/basic/pages/modal-pass-data/modal-pass-data.ts +++ b/src/components/modal/test/basic/pages/modal-pass-data/modal-pass-data.ts @@ -42,9 +42,7 @@ export class ModalPassData { submit() { console.time('modal'); - this.viewCtrl.dismiss(this.data).catch(() => { - console.log('submit was cancelled'); - }); + this.viewCtrl.dismiss(this.data); } ionViewCanEnter() { diff --git a/src/components/nav/nav-push.ts b/src/components/nav/nav-push.ts index 47d861bb6c..33b0f32d19 100644 --- a/src/components/nav/nav-push.ts +++ b/src/components/nav/nav-push.ts @@ -74,9 +74,7 @@ export class NavPush { @HostListener('click') onClick(): boolean { if (this._nav && this.navPush) { - this._nav.push(this.navPush, this.navParams).catch(() => { - console.debug('navPush was rejected'); - }); + this._nav.push(this.navPush, this.navParams); return false; } return true; diff --git a/src/components/nav/test/basic/pages/first-page/first-page.ts b/src/components/nav/test/basic/pages/first-page/first-page.ts index 1fc238c2d1..5a318ce405 100644 --- a/src/components/nav/test/basic/pages/first-page/first-page.ts +++ b/src/components/nav/test/basic/pages/first-page/first-page.ts @@ -84,6 +84,7 @@ export class FirstPage { } ionViewCanLeave() { + this.called.ionViewCanLeave++; if (this.canLeave) { return true; } @@ -93,8 +94,6 @@ export class FirstPage { alert.addButton({ text: 'Umm, ok', role: 'cancel', }); alert.present(); - this.called.ionViewCanLeave++; - return false; } @@ -132,7 +131,6 @@ export class FirstPage { this.navCtrl.push('full-page', { id: 8675309, myData: [1, 2, 3, 4] }, { animate: true, animation: 'md-transition' - }).catch(() => { }); } @@ -140,36 +138,30 @@ export class FirstPage { this.navCtrl.push('another-page', null, { animate: true, animation: 'wp-transition' - }).catch(() => { }); } pushTabsPage() { - this.navCtrl.push('tabs').catch(() => { - }); + this.navCtrl.push('tabs'); } quickPush() { - this.navCtrl.push('another-page').catch(() => { - }); + this.navCtrl.push('another-page'); setTimeout(() => { - this.navCtrl.push('primary-header-page').catch(() => { - }); + this.navCtrl.push('primary-header-page'); }, 150); } quickPop() { - this.navCtrl.push('another-page').catch(() => { - }); + this.navCtrl.push('another-page'); setTimeout(() => { - this.navCtrl.remove(1, 1).catch(() => { - }); + this.navCtrl.remove(1, 1); }, 250); } pop() { - this.navCtrl.pop().catch(() => {}); + this.navCtrl.pop(); } viewDismiss() { diff --git a/src/components/nav/test/basic/pages/tab-three/tab-three.ts b/src/components/nav/test/basic/pages/tab-three/tab-three.ts index dfecf2d3d7..0a6e05a7f1 100644 --- a/src/components/nav/test/basic/pages/tab-three/tab-three.ts +++ b/src/components/nav/test/basic/pages/tab-three/tab-three.ts @@ -42,6 +42,7 @@ export class Tab3 { } presentModal() { + console.debug('modal was commented out'); // this.modalCtrl.create(MyModal).present(); } diff --git a/src/components/nav/test/worst-case/app.module.ts b/src/components/nav/test/worst-case/app.module.ts index 1671b56479..4dcfc1f59f 100644 --- a/src/components/nav/test/worst-case/app.module.ts +++ b/src/components/nav/test/worst-case/app.module.ts @@ -132,9 +132,11 @@ export class Page4 extends Base { setTimeout(() => { this.doSomethingSync(); setTimeout(() => { - this.nav.push(Page5).catch(() => { - this.nav.push(Page6, { continue: false }); - setTimeout(() => this.nav.push(Page6, { continue: true }), 510); + this.nav.push(Page5).then((hasCompleted) => { + if (!hasCompleted) { + this.nav.push(Page6, { continue: false }); + setTimeout(() => this.nav.push(Page6, { continue: true }), 510); + } }); }, 2000); }, 0); @@ -202,10 +204,12 @@ export class Page6 extends Base { } pop() { - this.nav.pop().then(() => { - this.pushPage7(); - }).catch(() => { - this.pop(); + this.nav.pop().then((hasCompleted) => { + if (hasCompleted) { + this.pushPage7(); + } else { + this.pop(); + } }); } diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 0593ab8358..7472488b3b 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -506,9 +506,7 @@ export class Tabs extends Ion implements AfterViewInit, RootNode { } else if (tab.length() > 1) { // if we're a few pages deep, pop to root - tab.popToRoot().catch(() => { - console.debug('Tabs: pop to root was cancelled'); - }); + tab.popToRoot(); } else { getComponent(this._linker, tab.root).then(viewController => { if (viewController.component !== active.component) { diff --git a/src/components/tabs/test/advanced/pages/tab1-page1/tab1-page1.ts b/src/components/tabs/test/advanced/pages/tab1-page1/tab1-page1.ts index 46ee24017c..c762337481 100644 --- a/src/components/tabs/test/advanced/pages/tab1-page1/tab1-page1.ts +++ b/src/components/tabs/test/advanced/pages/tab1-page1/tab1-page1.ts @@ -28,9 +28,7 @@ export class Tab1Page1 { } logout() { - this.app.getRootNav().setRoot('sign-in', null, { animate: true, direction: 'back' }).catch(() => { - console.debug('logout cancelled'); - }); + this.app.getRootNav().setRoot('sign-in', null, { animate: true, direction: 'back' }); } ionViewWillEnter() { diff --git a/src/components/tabs/test/advanced/pages/tabs-page/tabs.ts b/src/components/tabs/test/advanced/pages/tabs-page/tabs.ts index 2104292d6d..df84b044ab 100644 --- a/src/components/tabs/test/advanced/pages/tabs-page/tabs.ts +++ b/src/components/tabs/test/advanced/pages/tabs-page/tabs.ts @@ -37,9 +37,7 @@ export class TabsPage { } logout() { - this.navCtrl.pop().catch(() => { - console.log('Cannot go back.'); - }); + this.navCtrl.pop(); } ionViewCanLeave() { diff --git a/src/navigation/nav-controller.ts b/src/navigation/nav-controller.ts index 13d64895f6..7fd557c3b8 100644 --- a/src/navigation/nav-controller.ts +++ b/src/navigation/nav-controller.ts @@ -279,8 +279,7 @@ import { ViewController } from './view-controller'; * ){} * * pushPage(){ - * this.navCtrl.push(DetailPage) - * .catch(()=> console.log('should I stay or should I go now')) + * this.navCtrl.push(DetailPage); * } * * ionViewCanLeave(): boolean{ @@ -305,8 +304,7 @@ import { ViewController } from './view-controller'; * ){} * * pushPage(){ - * this.navCtrl.push(DetailPage) - * .catch(()=> console.log('should I stay or should I go now')) + * this.navCtrl.push(DetailPage); * } * * }