From a26b054a3ffa35f47d3d5d87089389a2e9a33b71 Mon Sep 17 00:00:00 2001 From: Dan Bucholtz Date: Thu, 2 Mar 2017 15:01:42 -0600 Subject: [PATCH] refactor(tabs): support async loading support async loading --- src/components/tabs/tabs.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/tabs/tabs.ts b/src/components/tabs/tabs.ts index 75d082a409..956cf3da77 100644 --- a/src/components/tabs/tabs.ts +++ b/src/components/tabs/tabs.ts @@ -532,11 +532,14 @@ export class Tabs extends Ion implements AfterViewInit { tab.popToRoot().catch(() => { console.debug('Tabs: pop to root was cancelled'); }); - - } else if (getComponent(this._linker, tab.root) !== active.component) { - // Otherwise, if the page we're on is not our real root, reset it to our - // default root type - tab.setRoot(tab.root).catch(() => { + } else { + getComponent(this._linker, tab.root).then(viewController => { + if (viewController !== active.component) { + // Otherwise, if the page we're on is not our real root + // reset it to our default root type + return tab.setRoot(tab.root); + } + }).catch(() => { console.debug('Tabs: reset root was cancelled'); }); }