summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKalle Lindström <karl.lindstrom@mullvad.net>2025-08-14 15:20:51 +0200
committerKalle Lindström <karl.lindstrom@mullvad.net>2025-08-14 15:20:51 +0200
commitc81d6820b39eed5d81752793a408231c497b92bf (patch)
treecfb37913d3128b0980dd9affdfacf6c0d4c0006a
parent26aee1f7bc2e8e13e4c3e9f900197ca2c232874b (diff)
downloadmullvadvpn-c81d6820b39eed5d81752793a408231c497b92bf.tar.xz
mullvadvpn-c81d6820b39eed5d81752793a408231c497b92bf.zip
Set the default location set flag at login
If the user has managed to log in we unconditionally set update_default_location = false. This is done to prevent an edge case where the geolocation request completes after the user has logged in and then the default location could change while the user is in the process of clicking the select location/connect buttons.
-rw-r--r--mullvad-daemon/src/lib.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs
index 62c4e443ea..1825c09d95 100644
--- a/mullvad-daemon/src/lib.rs
+++ b/mullvad-daemon/src/lib.rs
@@ -1562,6 +1562,19 @@ impl Daemon {
error.display_chain_with_msg("Failed to update account history")
);
}
+ if self.settings.update_default_location {
+ if let Err(e) = self
+ .settings
+ .update(move |settings| settings.update_default_location = false)
+ .await
+ .map_err(Error::SettingsError)
+ {
+ log::error!(
+ "{}",
+ e.display_chain_with_msg("Unable to save has_updated_default_country")
+ );
+ }
+ }
if *self.target_state == TargetState::Secured {
log::debug!("Initiating tunnel restart because the account number changed");
self.reconnect_tunnel();