From 9b546591e7038498b2ca535214177f4afe2829df Mon Sep 17 00:00:00 2001 From: Said Rehouni Date: Thu, 11 Jul 2024 23:31:58 +0200 Subject: [PATCH] KM-4856: Use same DefaultServerProvider instance across the app --- PIA VPN-tvOS/Bootstraper/BootstraperFactory.swift | 1 + .../Presentation/DedicatedIPViewModel.swift | 10 ++++++---- PIA VPN.xcodeproj/project.pbxproj | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/PIA VPN-tvOS/Bootstraper/BootstraperFactory.swift b/PIA VPN-tvOS/Bootstraper/BootstraperFactory.swift index dc4efdc0..1f7071dc 100644 --- a/PIA VPN-tvOS/Bootstraper/BootstraperFactory.swift +++ b/PIA VPN-tvOS/Bootstraper/BootstraperFactory.swift @@ -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() { diff --git a/PIA VPN-tvOS/DedicatedIp/Presentation/DedicatedIPViewModel.swift b/PIA VPN-tvOS/DedicatedIp/Presentation/DedicatedIPViewModel.swift index f0601cd8..b507a928 100644 --- a/PIA VPN-tvOS/DedicatedIp/Presentation/DedicatedIPViewModel.swift +++ b/PIA VPN-tvOS/DedicatedIp/Presentation/DedicatedIPViewModel.swift @@ -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 @@ -55,8 +57,8 @@ class DedicatedIPViewModel: ObservableObject { do { try await activateDIPToken(token: token) - onAppear() Task { @MainActor in + onAppear() showActivatedDialog = true } } catch { diff --git a/PIA VPN.xcodeproj/project.pbxproj b/PIA VPN.xcodeproj/project.pbxproj index 01692d54..e8f4d52d 100644 --- a/PIA VPN.xcodeproj/project.pbxproj +++ b/PIA VPN.xcodeproj/project.pbxproj @@ -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 */