diff --git a/PIA VPN/DashboardViewController.swift b/PIA VPN/DashboardViewController.swift index 15dbf182..c1cc246c 100644 --- a/PIA VPN/DashboardViewController.swift +++ b/PIA VPN/DashboardViewController.swift @@ -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) + } } } diff --git a/PIA VPN/PIAWelcomeViewController.swift b/PIA VPN/PIAWelcomeViewController.swift index 822d4add..722a0c1a 100644 --- a/PIA VPN/PIAWelcomeViewController.swift +++ b/PIA VPN/PIAWelcomeViewController.swift @@ -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) + } } }