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

Commit

Permalink
Fix #7449- Ref #7413: VPN Region country flag is not shown when relau…
Browse files Browse the repository at this point in the history
…nching Brave - VPN profile fails to initialize after purchase (#7571)

Setting user as paying user before fetching a fresh profile
Update package Guardian_Connect to 1.8.5 release
  • Loading branch information
soner-yuksel authored Jun 12, 2023
1 parent cee1a48 commit f5daa99
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/GuardianFirewall/GuardianConnect",
"state" : {
"revision" : "cf99f1babca17a3d94ea20e2fc56cc48dfd65575",
"version" : "1.8.4"
"revision" : "2b97ae55edd9642cf721520129e807e576642e4f",
"version" : "1.8.5"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var package = Package(
.package(url: "https://github.com/apple/swift-algorithms", from: "1.0.0"),
.package(url: "https://github.com/devxoul/Then", from: "2.7.0"),
.package(url: "https://github.com/mkrd/Swift-BigInt", from: "2.0.0"),
.package(url: "https://github.com/GuardianFirewall/GuardianConnect", exact: "1.8.4"),
.package(url: "https://github.com/GuardianFirewall/GuardianConnect", exact: "1.8.5"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "0.6.0"),
.package(name: "Static", path: "ThirdParty/Static"),
],
Expand Down
5 changes: 4 additions & 1 deletion Sources/BraveVPN/BraveVPN.swift
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,14 @@ public class BraveVPN {
let activeTunnelProtocol = GRDTransportProtocol.getUserPreferredTransportProtocol()

helper.configureFirstTimeUser(for: activeTunnelProtocol, with: region) { success, error in
let subcredentials = "Credentials \(GRDKeychain.getPasswordString(forAccount: kKeychainStr_SubscriberCredential) ?? "Empty")"

if success {
Logger.module.debug("Changed VPN region to \(region?.regionName ?? "default selection")")
completion(true)
} else {
Logger.module.debug("connection failed: \(error ?? "nil")")
Logger.module.debug("Connection failed: \(error ?? "nil")")
Logger.module.debug("Region change connection failed for subcredentials \(subcredentials)")
completion(false)
}
}
Expand Down
5 changes: 5 additions & 0 deletions Sources/BraveVPN/InstallVPNViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import UIKit
import Shared
import Lottie
import BraveUI
import GuardianConnect

class InstallVPNViewController: VPNSetupLoadingController {

Expand Down Expand Up @@ -52,6 +53,10 @@ class InstallVPNViewController: VPNSetupLoadingController {
@objc func installVPNAction() {
isLoading = true

// Used to set whether our current user is actively a paying customer
// This has to be set before adding the profile otherwise it might fail
GRDSubscriptionManager.setIsPayingUser(true)

installProfileAndConnectVPNFirstTime { [weak self] status in
guard let self else { return }

Expand Down

0 comments on commit f5daa99

Please sign in to comment.