mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
fix(view-controller): dismiss does not crash when called more than once
fixes #8395
This commit is contained in:
@ -180,6 +180,10 @@ export class ViewController {
|
||||
*
|
||||
*/
|
||||
dismiss(data?: any, role?: any, navOptions: NavOptions = {}) {
|
||||
if (!this._nav) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
let options = merge({}, this._leavingOpts, navOptions);
|
||||
this._onWillDismiss && this._onWillDismiss(data, role);
|
||||
return this._nav.remove(this._nav.indexOf(this), 1, options).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user