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

Commit

Permalink
Fixing retry and loading cases
Browse files Browse the repository at this point in the history
  • Loading branch information
soner-yuksel committed May 26, 2023
1 parent 8fcb8c8 commit bd15c97
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Sources/BraveVPN/InstallVPNViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ class InstallVPNViewController: VPNSetupLoadingController {
self.dismiss(animated: true) {
self.showSuccessAlert()
}
} else if self.installVPNProfileRetryCount < 2 {
// Retry installing profile if it fails first time
presentErrorVPNInstallProfile()
} else {
// Retry installing profile twice if it fails
// Error generated is WireGuard capabilities are not yet enabled on this node
if self.installVPNProfileRetryCount < 2 {
installVPNAction()
} else {
presentErrorVPNInstallProfile()
}
}
}

Expand All @@ -83,7 +88,7 @@ class InstallVPNViewController: VPNSetupLoadingController {

BraveVPN.connectToVPN() { [weak self] status in
DispatchQueue.main.async {
self?.isLoading = true
self?.isLoading = false
}

completion(status)
Expand Down

0 comments on commit bd15c97

Please sign in to comment.