summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mullvad-daemon/src/lib.rs30
1 files changed, 14 insertions, 16 deletions
diff --git a/mullvad-daemon/src/lib.rs b/mullvad-daemon/src/lib.rs
index 1825c09d95..f371b9a91a 100644
--- a/mullvad-daemon/src/lib.rs
+++ b/mullvad-daemon/src/lib.rs
@@ -1562,18 +1562,17 @@ impl Daemon {
error.display_chain_with_msg("Failed to update account history")
);
}
- if self.settings.update_default_location {
- if let Err(e) = self
+ if self.settings.update_default_location
+ && 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")
- );
- }
+ {
+ 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");
@@ -2389,18 +2388,17 @@ impl Daemon {
Self::oneshot_send(tx, Err(e), "set_relay_settings response");
}
}
- if self.settings.update_default_location {
- if let Err(e) = self
+ if self.settings.update_default_location
+ && 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")
- );
- }
+ {
+ log::error!(
+ "{}",
+ e.display_chain_with_msg("Unable to save has_updated_default_country")
+ );
}
}