From 4d734930860c46d313ed2831b3552e5102fc4784 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Mon, 9 Nov 2015 14:43:19 -0600 Subject: [PATCH] fix(tabs): better preload preventing --- ionic/components/tabs/tab.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ionic/components/tabs/tab.ts b/ionic/components/tabs/tab.ts index 05718c332b..e287f7af02 100644 --- a/ionic/components/tabs/tab.ts +++ b/ionic/components/tabs/tab.ts @@ -90,14 +90,16 @@ export class Tab extends NavController { this.tabs.select(this); } else if (this.tabs.preloadTabs) { - this._loadTm = setTimeout(() => { - let opts = { - animate: false, - preload: true - }; - this.load(opts, () => { - this.hideNavbars(true); - }); + setTimeout(() => { + if (!this._loaded) { + let opts = { + animate: false, + preload: true + }; + this.load(opts, () => { + this.hideNavbars(true); + }); + } }, 1000 * this.index); } } @@ -114,8 +116,6 @@ export class Tab extends NavController { loadPage(viewCtrl, navbarContainerRef, done) { // by default a page's navbar goes into the shared tab's navbar section - clearTimeout(this._loadTm); - navbarContainerRef = this.tabs.navbarContainerRef; let isTabSubPage = (this.tabs.subPages && viewCtrl.index > 0);