refactor: platform specific logic from view common

This commit is contained in:
Martin Yankov
2019-05-21 13:42:10 +03:00
committed by GitHub
parent be6e408fff
commit d60e5dace4
2 changed files with 7 additions and 5 deletions

View File

@ -350,11 +350,7 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
} }
} }
if (isAndroid || (parent.viewController && parent.viewController.presentedViewController)) { that._hideNativeModalView(parent, whenClosedCallback);
that._hideNativeModalView(parent, whenClosedCallback);
} else {
whenClosedCallback();
}
} }
}; };
} }

View File

@ -452,6 +452,12 @@ export class View extends ViewCommon {
return; return;
} }
// modal view has already been closed by UI, probably as a popover
if (!parent.viewController.presentedViewController) {
whenClosedCallback();
return;
}
const parentController = parent.viewController; const parentController = parent.viewController;
const animated = (<any>this.viewController).animated; const animated = (<any>this.viewController).animated;