mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 05:21:52 +08:00
@ -378,7 +378,7 @@ export class NavControllerBase extends Ion implements NavController {
|
|||||||
opts.direction = opts.direction || DIRECTION_BACK;
|
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');
|
assert(finalBalance >= 0, 'final balance can not be negative');
|
||||||
if (finalBalance === 0 && !this._isPortal) {
|
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.`,
|
console.warn(`You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.`,
|
||||||
|
@ -108,6 +108,7 @@ describe('ViewController', () => {
|
|||||||
// arrange
|
// arrange
|
||||||
let viewController = mockView();
|
let viewController = mockView();
|
||||||
let navControllerBase = mockNavController();
|
let navControllerBase = mockNavController();
|
||||||
|
navControllerBase._isPortal = true;
|
||||||
mockViews(navControllerBase, [viewController]);
|
mockViews(navControllerBase, [viewController]);
|
||||||
|
|
||||||
viewController.onDidDismiss((data: any) => {
|
viewController.onDidDismiss((data: any) => {
|
||||||
@ -122,6 +123,7 @@ describe('ViewController', () => {
|
|||||||
// arrange
|
// arrange
|
||||||
let viewController = mockView();
|
let viewController = mockView();
|
||||||
let navControllerBase = mockNavController();
|
let navControllerBase = mockNavController();
|
||||||
|
navControllerBase._isPortal = true;
|
||||||
mockViews(navControllerBase, [viewController]);
|
mockViews(navControllerBase, [viewController]);
|
||||||
|
|
||||||
viewController.onDidDismiss((data: any) => {
|
viewController.onDidDismiss((data: any) => {
|
||||||
|
@ -172,7 +172,7 @@ export class ViewController {
|
|||||||
* @returns {any} data Returns the data passed in, if any.
|
* @returns {any} data Returns the data passed in, if any.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
dismiss(data?: any, role?: any, navOptions: NavOptions = {}) {
|
dismiss(data?: any, role?: any, navOptions: NavOptions = {}): Promise<any> {
|
||||||
if (!this._nav) {
|
if (!this._nav) {
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user