Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ios/brave-ios/Sources/BraveVPN/BraveVPN.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,17 @@ public class BraveVPN {

/// Reconnects to the vpn.
/// The vpn must be configured prior to that otherwise it does nothing.
public static func reconnect() {
public static func reconnect(completion: ((Bool) -> Void)? = nil) {
if reconnectPending {
logAndStoreError("Can't reconnect the vpn while another reconnect is pending.")
return
}

reconnectPending = true

connectToVPN()
connectToVPN { status in
completion?(status)
}
}

/// Disconnects the vpn.
Expand Down
Loading