fix(nav): prevents to remove all views in the nav stack

fixes #9140
This commit is contained in:
Manu Mtz.-Almeida
2016-11-28 01:38:21 +01:00
parent 76df8412b4
commit 16bfb49395
3 changed files with 4 additions and 2 deletions

View File

@ -378,7 +378,7 @@ export class NavControllerBase extends Ion implements NavController {
opts.direction = opts.direction || DIRECTION_BACK;
}
const finalBalance = this._views.length + (insertViews ? insertViews.length : 0) - (destroyQueue ? destroyQueue.length : 0);
const finalBalance = this._views.length + (insertViews ? insertViews.length : 0) - (removeCount ? removeCount : 0);
assert(finalBalance >= 0, 'final balance can not be negative');
if (finalBalance === 0 && !this._isPortal) {
console.warn(`You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.`,