Skip to content

Commit

Permalink
fix(ui): update UIApplication+Ext.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajhilje committed Sep 2, 2024
1 parent e06ae71 commit 8d7c48b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions IVPNClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,9 @@ class AppDelegate: UIResponder {

private func showSecurityScreen() {
var showWindow = false
let topVC = UIApplication.topViewController()

if UIApplication.topViewController() as? AccountViewController != nil {
showWindow = true
}

if UIApplication.topViewController() as? LoginViewController != nil {
showWindow = true
}

if UIApplication.topViewController() as? CreateAccountViewController != nil {
if topVC is AccountViewController || topVC is LoginViewController || topVC is CreateAccountViewController {
showWindow = true
}

Expand Down
2 changes: 1 addition & 1 deletion IVPNClient/Utilities/Extensions/UIApplication+Ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension UIApplication {

var keyWindow: UIWindow? {
return self.connectedScenes
.filter { $0.activationState == .foregroundActive }
.filter { $0.activationState == .foregroundActive || $0.activationState == .foregroundInactive }
.first(where: { $0 is UIWindowScene })
.flatMap({ $0 as? UIWindowScene })?.windows
.first(where: \.isKeyWindow)
Expand Down

0 comments on commit 8d7c48b

Please sign in to comment.