From e91f74df2d95054397cd2780483f498a4c41b65c Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Mon, 17 Jul 2023 09:36:58 +0200 Subject: [PATCH 01/17] vendor: update FloatingPanel to v2.6.3 --- IVPNClient.xcodeproj/project.pbxproj | 4 +- .../FloatingPanelController+Ext.swift | 3 +- .../FloatingPanelMainLayout.swift | 163 ++++++++++++++---- .../MainScreen/MainViewController+Ext.swift | 6 +- .../MainScreen/MainViewController.swift | 3 +- 5 files changed, 136 insertions(+), 43 deletions(-) diff --git a/IVPNClient.xcodeproj/project.pbxproj b/IVPNClient.xcodeproj/project.pbxproj index d422ef218..703f5a118 100644 --- a/IVPNClient.xcodeproj/project.pbxproj +++ b/IVPNClient.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 53; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -3324,7 +3324,7 @@ repositoryURL = "https://github.com/scenee/FloatingPanel"; requirement = { kind = exactVersion; - version = 1.7.2; + version = 2.6.3; }; }; 82EC884529A12D510024CC40 /* XCRemoteSwiftPackageReference "SnapKit" */ = { diff --git a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelController+Ext.swift b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelController+Ext.swift index 5196bab9d..bfa23c373 100644 --- a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelController+Ext.swift +++ b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelController+Ext.swift @@ -27,8 +27,7 @@ import FloatingPanel extension FloatingPanelController { func setup() { - surfaceView.shadowHidden = true - surfaceView.contentInsets = .init(top: 20, left: 0, bottom: 0, right: 0) + surfaceView.contentPadding = .init(top: 20, left: 0, bottom: 0, right: 0) surfaceView.backgroundColor = UIColor.init(named: Theme.ivpnBackgroundPrimary) let contentViewController = NavigationManager.getControlPanelViewController() diff --git a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift index 01715b4cd..8272f954d 100644 --- a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift +++ b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift @@ -26,9 +26,9 @@ import FloatingPanel class FloatingPanelMainLayout: FloatingPanelLayout { - // MARK: - Override public properties - + var position: FloatingPanelPosition { .bottom } - public var initialPosition: FloatingPanelPosition { + var initialState: FloatingPanelState { if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { return .full } @@ -36,12 +36,11 @@ class FloatingPanelMainLayout: FloatingPanelLayout { return .half } - public var supportedPositions: Set { - if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { - return [.full] - } - - return [.full, .half] + var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] { + return [ + .full: FloatingPanelLayoutAnchor(absoluteInset: 0, edge: .top, referenceGuide: .safeArea), + .half: FloatingPanelLayoutAnchor(absoluteInset: halfHeight, edge: .bottom, referenceGuide: .safeArea) + ] } // MARK: - Private properties - @@ -60,37 +59,19 @@ class FloatingPanelMainLayout: FloatingPanelLayout { return 230 - bottomSafeArea } - // MARK: - Override public methods - - - public func insetFor(position: FloatingPanelPosition) -> CGFloat? { - if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { - switch position { - case .full: - return -20 - default: - return nil - } - } - - switch position { - case .full: - return 10 - case .half: - return halfHeight - default: - return nil - } - } - public func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint] { - if let surfaceView = surfaceView as? FloatingPanelSurfaceView { + if let surfaceView = surfaceView as? SurfaceView { + let appearance = SurfaceAppearance() + if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { surfaceView.grabberHandle.isHidden = true - surfaceView.cornerRadius = 0 + appearance.cornerRadius = 0 } else { surfaceView.grabberHandle.isHidden = false - surfaceView.cornerRadius = 15 + appearance.cornerRadius = 15 } + + surfaceView.appearance = appearance } if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { @@ -113,8 +94,8 @@ class FloatingPanelMainLayout: FloatingPanelLayout { ] } - public func backdropAlphaFor(position: FloatingPanelPosition) -> CGFloat { - if position == .full && (UIDevice.current.userInterfaceIdiom == .phone || UIWindow.isPortrait) { + public func backdropAlpha(for state: FloatingPanelState) -> CGFloat { + if state == .full && (UIDevice.current.userInterfaceIdiom == .phone || UIWindow.isPortrait) { return 0.3 } @@ -122,3 +103,115 @@ class FloatingPanelMainLayout: FloatingPanelLayout { } } + +class MainFloatingPanelBehavior: FloatingPanelBehavior { + + func allowsRubberBanding(for edge: UIRectEdge) -> Bool { + return false + } + + func shouldProjectMomentum(_ fpc: FloatingPanelController, to proposedTargetPosition: FloatingPanelState) -> Bool { + return false + } + +} + +//class FloatingPanelMainLayout: FloatingPanelLayout { +// +// // MARK: - Override public properties - +// +// public var initialPosition: FloatingPanelPosition { +// if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { +// return .full +// } +// +// return .half +// } +// +// public var supportedPositions: Set { +// if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { +// return [.full] +// } +// +// return [.full, .half] +// } +// +// // MARK: - Private properties - +// +// private let bottomSafeArea = UIWindow.keyWindow?.safeAreaInsets.bottom ?? 0 +// +// private var halfHeight: CGFloat { +// if Application.shared.settings.connectionProtocol.tunnelType() != .ipsec && UserDefaults.shared.isMultiHop { +// return 359 - bottomSafeArea +// } +// +// if Application.shared.settings.connectionProtocol.tunnelType() != .ipsec { +// return 274 - bottomSafeArea +// } +// +// return 230 - bottomSafeArea +// } +// +// // MARK: - Override public methods - +// +// public func insetFor(position: FloatingPanelPosition) -> CGFloat? { +// if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { +// switch position { +// case .full: +// return -20 +// default: +// return nil +// } +// } +// +// switch position { +// case .full: +// return 10 +// case .half: +// return halfHeight +// default: +// return nil +// } +// } +// +// public func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint] { +// if let surfaceView = surfaceView as? FloatingPanelSurfaceView { +// if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { +// surfaceView.grabberHandle.isHidden = true +// surfaceView.cornerRadius = 0 +// } else { +// surfaceView.grabberHandle.isHidden = false +// surfaceView.cornerRadius = 15 +// } +// } +// +// if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { +// return [ +// surfaceView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 0), +// surfaceView.widthAnchor.constraint(equalToConstant: 375) +// ] +// } +// +// if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isPortrait && !UIApplication.shared.isSplitOrSlideOver { +// return [ +// surfaceView.widthAnchor.constraint(equalToConstant: 520), +// surfaceView.centerXAnchor.constraint(equalTo: view.safeAreaLayoutGuide.centerXAnchor) +// ] +// } +// +// return [ +// surfaceView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 0), +// surfaceView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor, constant: 0) +// ] +// } +// +// public func backdropAlphaFor(position: FloatingPanelPosition) -> CGFloat { +// if position == .full && (UIDevice.current.userInterfaceIdiom == .phone || UIWindow.isPortrait) { +// return 0.3 +// } +// +// return 0 +// } +// +//} + diff --git a/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift b/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift index a6f43f1ec..ac69a0dd3 100644 --- a/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift +++ b/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift @@ -28,7 +28,7 @@ import FloatingPanel extension MainViewController: FloatingPanelControllerDelegate { - func floatingPanel(_ vc: FloatingPanelController, layoutFor newCollection: UITraitCollection) -> FloatingPanelLayout? { + func floatingPanel(_ vc: FloatingPanelController, layoutFor newCollection: UITraitCollection) -> FloatingPanelLayout { updateAccessibilityLabel(vc: vc) return FloatingPanelMainLayout() @@ -44,7 +44,7 @@ extension MainViewController: FloatingPanelControllerDelegate { func updateAccessibilityLabel(vc: FloatingPanelController) { if let controlPanelViewController = floatingPanel.contentViewController, UIDevice.current.userInterfaceIdiom != .pad { - if vc.position == .full { + if vc.state == .full { controlPanelViewController.view.accessibilityLabel = "Swipe down to collapse control panel" } else { controlPanelViewController.view.accessibilityLabel = "Swipe up to expan control panel" @@ -59,7 +59,7 @@ extension MainViewController: FloatingPanelControllerDelegate { extension MainViewController: UIAdaptivePresentationControllerDelegate { func presentationControllerWillDismiss(_ presentationController: UIPresentationController) { - floatingPanel.updateLayout() + floatingPanel.invalidateLayout() NotificationCenter.default.post(name: Notification.Name.UpdateControlPanel, object: nil) } diff --git a/IVPNClient/Scenes/MainScreen/MainViewController.swift b/IVPNClient/Scenes/MainScreen/MainViewController.swift index 0539f5e6b..c0c83d0e5 100644 --- a/IVPNClient/Scenes/MainScreen/MainViewController.swift +++ b/IVPNClient/Scenes/MainScreen/MainViewController.swift @@ -202,7 +202,7 @@ class MainViewController: UIViewController { // MARK: - Private methods - @objc private func updateFloatingPanelLayout() { - floatingPanel.updateLayout() + floatingPanel.invalidateLayout() mainView.setupView(animated: false) } @@ -237,6 +237,7 @@ class MainViewController: UIViewController { floatingPanel.delegate = self floatingPanel.addPanel(toParent: self) floatingPanel.show(animated: true) + floatingPanel.behavior = MainFloatingPanelBehavior() } private func startAPIUpdate() { From c9ba3571621e53729dd37dbe173277bdcb95e59d Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Mon, 17 Jul 2023 17:31:02 +0200 Subject: [PATCH 02/17] vendor: update FloatingPanelMainLayout.swift --- .../MainScreen/ControlPanel/FloatingPanelMainLayout.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift index 8272f954d..eb7680fb8 100644 --- a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift +++ b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift @@ -62,6 +62,10 @@ class FloatingPanelMainLayout: FloatingPanelLayout { public func prepareLayout(surfaceView: UIView, in view: UIView) -> [NSLayoutConstraint] { if let surfaceView = surfaceView as? SurfaceView { let appearance = SurfaceAppearance() + let shadow = SurfaceAppearance.Shadow() + shadow.color = .clear + appearance.shadows = [shadow] + appearance.backgroundColor = UIColor.init(named: Theme.ivpnBackgroundPrimary) if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { surfaceView.grabberHandle.isHidden = true From 63144cb686c6e3c8493e09637d558b2b6e7fef56 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Fri, 29 Sep 2023 09:04:45 +0200 Subject: [PATCH 03/17] refactor: update FloatingPanelControllerDelegate in MainViewController+Ext --- IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift b/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift index 975fbac50..72ecae325 100644 --- a/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift +++ b/IVPNClient/Scenes/MainScreen/MainViewController+Ext.swift @@ -52,6 +52,13 @@ extension MainViewController: FloatingPanelControllerDelegate { } } + func floatingPanelDidMove(_ fpc: FloatingPanelController) { + let loc = fpc.surfaceLocation + let minY = fpc.surfaceLocation(for: .full).y - 6.0 + let maxY = fpc.surfaceLocation(for: .half).y + 6.0 + fpc.surfaceLocation = CGPoint(x: loc.x, y: min(max(loc.y, minY), maxY)) + } + } // MARK: - UIAdaptivePresentationControllerDelegate - From dc67c3a00536b22fd78d3a270948237afe91a674 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Fri, 29 Sep 2023 09:31:07 +0200 Subject: [PATCH 04/17] refactor: update FloatingPanelMainLayout --- .../ControlPanel/FloatingPanelMainLayout.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift index f7bbd3896..aa55b1624 100644 --- a/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift +++ b/IVPNClient/Scenes/MainScreen/ControlPanel/FloatingPanelMainLayout.swift @@ -26,7 +26,13 @@ import FloatingPanel class FloatingPanelMainLayout: FloatingPanelLayout { - var position: FloatingPanelPosition { .bottom } + var position: FloatingPanelPosition { + if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { + return .top + } + + return .bottom + } var initialState: FloatingPanelState { if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { @@ -37,6 +43,12 @@ class FloatingPanelMainLayout: FloatingPanelLayout { } var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] { + if UIDevice.current.userInterfaceIdiom == .pad && UIWindow.isLandscape && !UIApplication.shared.isSplitOrSlideOver { + return [ + .full: FloatingPanelLayoutAnchor(absoluteInset: 0, edge: .bottom, referenceGuide: .superview) + ] + } + return [ .full: FloatingPanelLayoutAnchor(absoluteInset: 0, edge: .top, referenceGuide: .safeArea), .half: FloatingPanelLayoutAnchor(absoluteInset: halfHeight, edge: .bottom, referenceGuide: .safeArea) From f8462fefebfa97811477a226fb9e62178324ea66 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Fri, 29 Sep 2023 11:10:33 +0200 Subject: [PATCH 05/17] refactor: add showFloatingPanel method in MainViewController --- IVPNClient/Scenes/MainScreen/MainViewController.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/IVPNClient/Scenes/MainScreen/MainViewController.swift b/IVPNClient/Scenes/MainScreen/MainViewController.swift index ef79093e7..096097fd2 100644 --- a/IVPNClient/Scenes/MainScreen/MainViewController.swift +++ b/IVPNClient/Scenes/MainScreen/MainViewController.swift @@ -82,6 +82,9 @@ class MainViewController: UIViewController { refreshUI() initConnectionInfo() startPingService() + DispatchQueue.async { [self] in + showFloatingPanel() + } } deinit { @@ -202,6 +205,10 @@ class MainViewController: UIViewController { // MARK: - Private methods - @objc private func updateFloatingPanelLayout() { + guard floatingPanel != nil else { + return + } + floatingPanel.invalidateLayout() mainView.setupView(animated: false) } @@ -240,6 +247,10 @@ class MainViewController: UIViewController { floatingPanel.behavior = MainFloatingPanelBehavior() } + private func showFloatingPanel() { + floatingPanel.show(animated: true) + } + private func startAPIUpdate() { updateServersList() Timer.scheduledTimer(timeInterval: 60 * 15, target: self, selector: #selector(updateServersList), userInfo: nil, repeats: true) From 9c496ccc02dadb8695c400f1765e65c930acdd91 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Fri, 6 Oct 2023 09:34:52 +0200 Subject: [PATCH 06/17] chore: update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6291052dd..c305cde2c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -22,7 +22,7 @@ As a contributor, here are the guidelines we would like you to follow: ## Creating an Issue * If you want to report a security problem **DO NOT CREATE AN ISSUE**, please read our [Security Policy](/.github/SECURITY.md) on how to submit a security vulnerability. -* When creating a new issue, chose a "Bug report" or "Feature request" template and fill the required information. +* When creating a new issue, choose a "Bug report" or "Feature request" template and fill the required information. * Please describe the steps necessary to reproduce the issue you are running into. From d19d7e4adb06decd9a4d721b1a9b5d063e6b8212 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Mon, 9 Oct 2023 09:47:49 +0200 Subject: [PATCH 07/17] refactor: update baseURL in APIClient.swift --- IVPNClient/Managers/APIClient.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IVPNClient/Managers/APIClient.swift b/IVPNClient/Managers/APIClient.swift index aa6942fec..226d69a85 100644 --- a/IVPNClient/Managers/APIClient.swift +++ b/IVPNClient/Managers/APIClient.swift @@ -98,7 +98,15 @@ class APIClient: NSObject { private var hostName = UserDefaults.shared.apiHostName private var baseURL: URL { - return URL(string: "https://\(hostName)")! + if let url = URL(string: "https://\(hostName)") { + return url + } + + if let url = URL(string: "https://[\(hostName)]") { + return url + } + + return URL(string: "https://\(Config.ApiHostName)")! } private var userAgent: String { From 9d3724b54fd27ba4a42823ac56b3839e9e60ec96 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Mon, 9 Oct 2023 09:52:31 +0200 Subject: [PATCH 08/17] refactor: add NSExceptionDomains in Info.plist List API IP addresses to allow performing manual server trust authentication --- IVPNClient/Info.plist | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/IVPNClient/Info.plist b/IVPNClient/Info.plist index 793cbe51c..96570728d 100644 --- a/IVPNClient/Info.plist +++ b/IVPNClient/Info.plist @@ -74,5 +74,67 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + NSAppTransportSecurity + + NSExceptionDomains + + 198.50.177.220 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 149.56.162.156 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 198.50.177.222 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 149.56.162.159 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 198.50.177.223 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 2607:5300:203:1735::8888 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 2607:5300:203:1735::8 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 2607:5300:203:1735:6580:7300:0:aaaa + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + + From d44f933eec95d28030a17f1f62e0c885e070e03f Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Wed, 11 Oct 2023 16:23:27 +0200 Subject: [PATCH 09/17] feat: update ServiceStatus.swift --- IVPNClient/Models/ServiceStatus.swift | 2 +- IVPNClient/Scenes/Signup/LoginViewController.swift | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/IVPNClient/Models/ServiceStatus.swift b/IVPNClient/Models/ServiceStatus.swift index 9da217960..6d78209cf 100644 --- a/IVPNClient/Models/ServiceStatus.swift +++ b/IVPNClient/Models/ServiceStatus.swift @@ -116,7 +116,7 @@ struct ServiceStatus: Codable { func isLegacyAccount() -> Bool { let accountId = KeyChain.username ?? "" - if accountId.hasPrefix("ivpn") && currentPlan.hasPrefix("IVPN Pro") && currentPlan != "IVPN Pro" { + if accountId.hasPrefix("ivpn") && currentPlan.contains("VPN Pro") && currentPlan != "IVPN Pro" { return true } diff --git a/IVPNClient/Scenes/Signup/LoginViewController.swift b/IVPNClient/Scenes/Signup/LoginViewController.swift index 36042b089..14a3b5eac 100644 --- a/IVPNClient/Scenes/Signup/LoginViewController.swift +++ b/IVPNClient/Scenes/Signup/LoginViewController.swift @@ -279,6 +279,9 @@ extension LoginViewController { KeyChain.username = (self.userName.text ?? "").trim() guard !Application.shared.serviceStatus.isLegacyAccount() else { + navigationController?.dismiss(animated: true, completion: { + NotificationCenter.default.post(name: Notification.Name.UpdateFloatingPanelLayout, object: nil) + }) return } From 141c06786bf35af91a58ee49f30fa8de88b17568 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Wed, 11 Oct 2023 16:26:10 +0200 Subject: [PATCH 10/17] feat: update AccountView.swift --- .../AccountScreen/View/AccountView.swift | 4 +-- IVPNClient/Scenes/Base.lproj/Main.storyboard | 30 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/IVPNClient/Scenes/AccountScreen/View/AccountView.swift b/IVPNClient/Scenes/AccountScreen/View/AccountView.swift index ab6da068d..9962c1b07 100644 --- a/IVPNClient/Scenes/AccountScreen/View/AccountView.swift +++ b/IVPNClient/Scenes/AccountScreen/View/AccountView.swift @@ -33,7 +33,7 @@ class AccountView: UITableView { @IBOutlet weak var subscriptionLabel: UILabel! @IBOutlet weak var activeUntilLabel: UILabel! @IBOutlet weak var logOutActionButton: UIButton! - @IBOutlet weak var addMoreTimeButton: UIButton! + @IBOutlet weak var activeUntilCell: UITableViewCell! // MARK: - Properties - @@ -47,7 +47,7 @@ class AccountView: UITableView { statusLabel.backgroundColor = viewModel.statusColor subscriptionLabel.text = viewModel.subscriptionText activeUntilLabel.text = viewModel.activeUntilText - addMoreTimeButton.isHidden = Application.shared.serviceStatus.isLegacyAccount() + activeUntilCell.isHidden = Application.shared.serviceStatus.isLegacyAccount() } func initQRCode(viewModel: AccountViewModel) { diff --git a/IVPNClient/Scenes/Base.lproj/Main.storyboard b/IVPNClient/Scenes/Base.lproj/Main.storyboard index fa3f6c7f4..37046e480 100644 --- a/IVPNClient/Scenes/Base.lproj/Main.storyboard +++ b/IVPNClient/Scenes/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -528,14 +528,14 @@ - + -