Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Adding check prices to VPN settings launch part
Browse files Browse the repository at this point in the history
  • Loading branch information
soner-yuksel committed Nov 9, 2023
1 parent 08ff3a1 commit 49060aa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Sources/Brave/Frontend/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,18 @@ class SettingsViewController: TableViewController {
}()

guard let vcToShow = vc else { return }
self.navigationController?.pushViewController(vcToShow, animated: true)

if VPNProductInfo.isComplete {
self.navigationController?.pushViewController(vcToShow, animated: true)
} else {
let alert = UIAlertController(
title: Strings.VPN.errorCantGetPricesTitle,
message: Strings.VPN.errorCantGetPricesBody,
preferredStyle: .alert)

alert.addAction(UIAlertAction(title: Strings.OKString, style: .default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
},
image: Preferences.VPN.vpnReceiptStatus.value == BraveVPN.ReceiptResponse.Status.retryPeriod.rawValue
? UIImage(braveSystemNamed: "leo.warning.triangle-filled")?
Expand Down

0 comments on commit 49060aa

Please sign in to comment.