Skip to content

Commit

Permalink
KM-4856: Use same DefaultServerProvider instance across the app
Browse files Browse the repository at this point in the history
  • Loading branch information
kp-said-rehouni committed Jul 11, 2024
1 parent 585f48c commit 9b54659
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions PIA VPN-tvOS/Bootstraper/BootstraperFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class BootstraperFactory {

private static func loadDataBase() {
Client.database = Client.Database(group: AppConstants.appGroup)
Client.providers.serverProvider = ServerProviderFactory.makeDefaultServerProvider()
}

private static func setupPreferences() {
Expand Down
10 changes: 6 additions & 4 deletions PIA VPN-tvOS/DedicatedIp/Presentation/DedicatedIPViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class DedicatedIPViewModel: ObservableObject {

func onAppear() {
guard let server = getDedicatedIp(),
let dipIKEv2IP = server.dipIKEv2IP,
let dipStatusString = server.dipStatusString else {
dedicatedIPStats = []
let dipIKEv2IP = server.dipIKEv2IP,
let dipStatusString = server.dipStatusString else {
Task { @MainActor in
dedicatedIPStats = []
}
return
}
Task { @MainActor in
Expand All @@ -55,8 +57,8 @@ class DedicatedIPViewModel: ObservableObject {

do {
try await activateDIPToken(token: token)
onAppear()
Task { @MainActor in
onAppear()
showActivatedDialog = true
}
} catch {
Expand Down
4 changes: 2 additions & 2 deletions PIA VPN.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7770,8 +7770,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/pia-foss/mobile-ios-library.git";
requirement = {
kind = revision;
revision = e864a59d6d1aa2d820016dcac074bfc070a89aca;
branch = fix_dip_tvos_accounts_migration;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down

0 comments on commit 9b54659

Please sign in to comment.