Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent location view from being updated on every settings update #7135

Closed
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
7 changes: 6 additions & 1 deletion ios/MullvadVPN/Coordinators/LocationCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class LocationCoordinator: Coordinator, Presentable, Presenting {
private let relayCacheTracker: RelayCacheTracker
private let customListRepository: CustomListRepositoryProtocol
private var locationRelays: LocationRelays?
private var daitaSettings: DAITASettings

let navigationController: UINavigationController

Expand Down Expand Up @@ -52,6 +53,8 @@ class LocationCoordinator: Coordinator, Presentable, Presenting {
self.tunnelManager = tunnelManager
self.relayCacheTracker = relayCacheTracker
self.customListRepository = customListRepository

daitaSettings = tunnelManager.settings.daita
}

func start() {
Expand Down Expand Up @@ -99,7 +102,9 @@ class LocationCoordinator: Coordinator, Presentable, Presenting {
let tunnelObserver =
TunnelBlockObserver(
didUpdateTunnelSettings: { [weak self] _, settings in
guard let self, let locationRelays else { return }
guard let self, let locationRelays, settings.daita != daitaSettings else { return }
daitaSettings = settings.daita

locationViewControllerWrapper?.onDaitaSettingsUpdate(
settings.daita,
relaysWithLocation: locationRelays,
Expand Down
Loading