Skip to content

Commit

Permalink
KM-5043: Dismiss any other view that is presented before presenting F…
Browse files Browse the repository at this point in the history
…orce Update screen (#172)
  • Loading branch information
kp-laura-sempere authored Oct 10, 2024
1 parent 952eed3 commit effc428
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion PIA VPN/DashboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,20 @@ class DashboardViewController: AutolayoutViewController {
let forceUpdate = ForceUpdateViewController()
forceUpdate.modalPresentationStyle = .fullScreen
DispatchQueue.main.async { [weak self] in
self?.present(forceUpdate, animated: false)
var isOtherViewPresented = false
if let presented = self?.presentedViewController {
if !(presented is ForceUpdateViewController) {
isOtherViewPresented = true
}
}

if isOtherViewPresented {
self?.dismiss(animated: false, completion: {
self?.present(forceUpdate, animated: false)
})
} else {
self?.present(forceUpdate, animated: false)
}
}
}

Expand Down
15 changes: 14 additions & 1 deletion PIA VPN/PIAWelcomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,20 @@ public class PIAWelcomeViewController: AutolayoutViewController, WelcomeCompleti
let forceUpdate = ForceUpdateViewController()
forceUpdate.modalPresentationStyle = .fullScreen
DispatchQueue.main.async { [weak self] in
self?.present(forceUpdate, animated: false)
var isOtherViewPresented = false
if let presented = self?.presentedViewController {
if !(presented is ForceUpdateViewController) {
isOtherViewPresented = true
}
}

if isOtherViewPresented {
self?.dismiss(animated: false, completion: {
self?.present(forceUpdate, animated: false)
})
} else {
self?.present(forceUpdate, animated: false)
}
}
}

Expand Down

0 comments on commit effc428

Please sign in to comment.