Skip to content

Commit

Permalink
Merge branch 'develop' into FixFor734-unarchiveTopLevelObjectWithData
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Bert <5411131+timbms@users.noreply.github.com>
  • Loading branch information
timbms authored Oct 30, 2023
2 parents 7154805 + 0871990 commit 8a4c91a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openHAB/OpenHABRootViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ class OpenHABRootViewController: UIViewController {
if let menu = SideMenuManager.default.rightMenuNavigationController {
// don't try and push an already visible menu less you crash the app
dismiss(animated: false) {
var topMostViewController = UIApplication.shared.keyWindow?.rootViewController
var topMostViewController: UIViewController? = if #available(iOS 13, *) {
UIApplication.shared.connectedScenes.flatMap { ($0 as? UIWindowScene)?.windows ?? [] }.last { $0.isKeyWindow }?.rootViewController
} else {
UIApplication.shared.keyWindow?.rootViewController
}
while let presentedViewController = topMostViewController?.presentedViewController {
topMostViewController = presentedViewController
}
Expand Down

0 comments on commit 8a4c91a

Please sign in to comment.