Skip to content

Commit

Permalink
Merge branch 'task/disable-active-until-team-accounts' into staging-2…
Browse files Browse the repository at this point in the history
….11.0
  • Loading branch information
jurajhilje committed Oct 11, 2023
2 parents 2d46453 + 141c067 commit d6a470c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion IVPNClient/Models/ServiceStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions IVPNClient/Scenes/AccountScreen/View/AccountView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 -

Expand All @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions IVPNClient/Scenes/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="rTE-KQ-hdG">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="rTE-KQ-hdG">
<device id="retina6_1" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
Expand Down Expand Up @@ -4560,8 +4560,8 @@
</sections>
<connections>
<outlet property="accountIdLabel" destination="c74-BR-YIO" id="owd-hS-Ldx"/>
<outlet property="activeUntilCell" destination="d4r-dE-4nQ" id="N7w-fP-Y7L"/>
<outlet property="activeUntilLabel" destination="zC4-d3-7BM" id="7YJ-Yd-p6J"/>
<outlet property="addMoreTimeButton" destination="mlm-X9-XNL" id="jt8-yY-7gC"/>
<outlet property="dataSource" destination="obv-bO-Y0X" id="XXu-eT-PBh"/>
<outlet property="delegate" destination="obv-bO-Y0X" id="c2A-2b-bO7"/>
<outlet property="logOutActionButton" destination="MVS-Nm-wlG" id="Yqw-Wn-PH0"/>
Expand Down
3 changes: 3 additions & 0 deletions IVPNClient/Scenes/Signup/LoginViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit d6a470c

Please sign in to comment.