| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ import { View, ios as iosView } from "../core/view"; | |||
| 5 | 5 | import { ConfirmOptions, PromptOptions, PromptResult, LoginOptions, LoginResult, ActionOptions } from "."; | |
| 6 | 6 | import { getCurrentPage, getLabelColor, getButtonColors, getTextFieldColor, isDialogOptions, inputType, ALERT, OK, CONFIRM, CANCEL, PROMPT, LOGIN } from "./dialogs-common"; | |
| 7 | 7 | import { isString, isDefined, isFunction } from "../../utils/types"; | |
| 8 | + import { getRootView } from "../../application"; | ||
| 8 | 9 | ||
| 9 | 10 | export * from "./dialogs-common"; | |
| 10 | 11 | ||
@@ -198,20 +199,16 @@ export function login(): Promise<LoginResult> { | |||
| 198 | 199 | } | |
| 199 | 200 | ||
| 200 | 201 | function showUIAlertController(alertController: UIAlertController) { | |
| 201 | - let currentPage = getCurrentPage(); | ||
| 202 | - if (currentPage) { | ||
| 203 | - let view: View = currentPage; | ||
| 204 | - let viewController: UIViewController = currentPage.ios; | ||
| 205 | - | ||
| 206 | - if (currentPage.modal) { | ||
| 207 | - view = currentPage.modal; | ||
| 208 | - | ||
| 209 | - if (view.ios instanceof UIViewController) { | ||
| 210 | - viewController = view.ios; | ||
| 211 | - } else { | ||
| 212 | - const parentWithController = iosView.getParentWithViewController(view); | ||
| 213 | - viewController = parentWithController ? parentWithController.viewController : undefined; | ||
| 214 | - } | ||
| 202 | + let currentView = getCurrentPage() || getRootView(); | ||
| 203 | + | ||
| 204 | + if (currentView) { | ||
| 205 | + currentView = currentView.modal || currentView; | ||
| 206 | + | ||
| 207 | + let viewController: UIViewController = currentView.ios; | ||
| 208 | + | ||
| 209 | + if (!(currentView.ios instanceof UIViewController)) { | ||
| 210 | + const parentWithController = iosView.getParentWithViewController(currentView); | ||
| 211 | + viewController = parentWithController ? parentWithController.viewController : undefined; | ||
| 215 | 212 | } | |
| 216 | 213 | ||
| 217 | 214 | if (viewController) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments