Skip to content

Commit

Permalink
Fix brave/brave-ios#8087: VPN Reset Configuration Clear confirmation (b…
Browse files Browse the repository at this point in the history
  • Loading branch information
soner-yuksel authored Sep 25, 2023
1 parent 8e95649 commit b9372f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
10 changes: 10 additions & 0 deletions Sources/BraveStrings/BraveStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2950,6 +2950,16 @@ extension Strings {
NSLocalizedString("vpn.resetVPNErrorBody", tableName: "BraveShared", bundle: .module,
value: "Failed to reset vpn configuration, please try again later.",
comment: "Message to show when vpn configuration reset fails.")

public static let resetVPNSuccessTitle =
NSLocalizedString("vpn.resetVPNSuccessTitle", tableName: "BraveShared", bundle: .module,
value: "Success",
comment: "Title for success message when vpn configuration reset succeeds.")

public static let resetVPNSuccessBody =
NSLocalizedString("vpn.resetVPNSuccessBody", tableName: "BraveShared", bundle: .module,
value: "VPN Configuration is resetted successfully.",
comment: "Message to show when vpn configuration reset succeeds.")

public static let contactFormDoNotEditText =
NSLocalizedString("vpn.contactFormDoNotEditText", tableName: "BraveShared", bundle: .module,
Expand Down
12 changes: 6 additions & 6 deletions Sources/BraveVPN/BraveVPNSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ public class BraveVPNSettingsViewController: TableViewController {
self.isLoading = false
self.vpnReconfigurationPending = false
self.updateServerInfo()
if !success {
self.showVPNResetErrorAlert()
}
self.showVPNResetAlert(success: success)
}
}
})
Expand Down Expand Up @@ -294,9 +292,11 @@ public class BraveVPNSettingsViewController: TableViewController {
navigationController?.pushViewController(vc, animated: true)
}

private func showVPNResetErrorAlert() {
let alert = UIAlertController(title: Strings.VPN.resetVPNErrorTitle,
message: Strings.VPN.resetVPNErrorBody, preferredStyle: .alert)
private func showVPNResetAlert(success: Bool) {
let alert = UIAlertController(
title: success ? Strings.VPN.resetVPNSuccessTitle : Strings.VPN.resetVPNErrorTitle,
message: success ? Strings.VPN.resetVPNSuccessBody : Strings.VPN.resetVPNErrorBody,
preferredStyle: .alert)

let okAction = UIAlertAction(title: Strings.OKString, style: .default)
alert.addAction(okAction)
Expand Down
4 changes: 2 additions & 2 deletions Sources/BraveVPN/InstallVPNView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extension InstallVPNViewController {

let installVPNButton = BraveButton().then {
$0.setTitle(Strings.VPN.installProfileButtonText, for: .normal)
$0.backgroundColor = .braveBlurpleTint
$0.backgroundColor = .braveDarkerBlurple
$0.titleLabel?.font = .systemFont(ofSize: 16, weight: .semibold)
$0.setTitleColor(.white, for: .normal)
$0.snp.makeConstraints { make in
Expand All @@ -109,7 +109,7 @@ extension InstallVPNViewController {
let contactSupportButton = BraveButton(type: .system).then {
$0.setTitle(Strings.VPN.settingsContactSupport, for: .normal)
$0.titleLabel?.font = .systemFont(ofSize: 16)
$0.setTitleColor(.braveLabel, for: .normal)
$0.setTitleColor(.secondaryBraveLabel, for: .normal)
$0.snp.makeConstraints { make in
make.height.equalTo(44)
}
Expand Down

0 comments on commit b9372f5

Please sign in to comment.