Skip to content

Commit

Permalink
fix(dialogs-ios): dialogs not showing in single page apps (non Frame …
Browse files Browse the repository at this point in the history
…based apps) (#6000)
  • Loading branch information
ADjenkov authored and MartoYankov committed Jul 3, 2018
1 parent e557d66 commit 0082dfb
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions tns-core-modules/ui/dialogs/dialogs.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { View, ios as iosView } from "../core/view";
import { ConfirmOptions, PromptOptions, PromptResult, LoginOptions, LoginResult, ActionOptions } from ".";
import { getCurrentPage, getLabelColor, getButtonColors, getTextFieldColor, isDialogOptions, inputType, ALERT, OK, CONFIRM, CANCEL, PROMPT, LOGIN } from "./dialogs-common";
import { isString, isDefined, isFunction } from "../../utils/types";
import { getRootView } from "../../application";

export * from "./dialogs-common";

Expand Down Expand Up @@ -198,20 +199,16 @@ export function login(): Promise<LoginResult> {
}

function showUIAlertController(alertController: UIAlertController) {
let currentPage = getCurrentPage();
if (currentPage) {
let view: View = currentPage;
let viewController: UIViewController = currentPage.ios;

if (currentPage.modal) {
view = currentPage.modal;

if (view.ios instanceof UIViewController) {
viewController = view.ios;
} else {
const parentWithController = iosView.getParentWithViewController(view);
viewController = parentWithController ? parentWithController.viewController : undefined;
}
let currentView = getCurrentPage() || getRootView();

if (currentView) {
currentView = currentView.modal || currentView;

let viewController: UIViewController = currentView.ios;

if (!(currentView.ios instanceof UIViewController)) {
const parentWithController = iosView.getParentWithViewController(currentView);
viewController = parentWithController ? parentWithController.viewController : undefined;
}

if (viewController) {
Expand Down

0 comments on commit 0082dfb

Please sign in to comment.