Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KM-5043: Dismiss any other view that is presented before showing Force Update #172

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading