summaryrefslogtreecommitdiffhomepage
path: root/mullvad-management-interface/src
diff options
context:
space:
mode:
authorKalle Lindström <karl.lindstrom@mullvad.net>2025-08-07 09:12:51 +0200
committerKalle Lindström <karl.lindstrom@mullvad.net>2025-08-14 10:11:48 +0200
commit4e489750035e5d153cd833fbc6d50782df66241a (patch)
tree47cccac589c921c5c9b1c22a1a4a8c968df52dd3 /mullvad-management-interface/src
parentfe53ad976eb77fffbc845710804e0abd53e99904 (diff)
downloadmullvadvpn-4e489750035e5d153cd833fbc6d50782df66241a.tar.xz
mullvadvpn-4e489750035e5d153cd833fbc6d50782df66241a.zip
Set relay to current country on first start
Sets the default relay selection to the current country (as determined by am.i.mullvad.net). If the current country does not have any relays the country with the closest relay is choosen instead. In non-release builds of the Android app we do not bundle a relay list in the APK, and the relay list is fetched when the user logs in. So one of the following can happen: 1. Geolocation request returns, we have a relay list. 2. Geolocation request returns, we do not yet have a relay list. 3. Relay list request returns, we have a geolocation. 4. Relay list request returns, we do not have a geolocation. In 1. and 3. we can update the default location. In 2. we have to wait until the relay list is fetched from the api until we can update the default location. 4. is unlikely to happen but could happen if am.i.mullvad is down.
Diffstat (limited to 'mullvad-management-interface/src')
-rw-r--r--mullvad-management-interface/src/types/conversions/settings.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/mullvad-management-interface/src/types/conversions/settings.rs b/mullvad-management-interface/src/types/conversions/settings.rs
index 7b2e2b30d5..e9f68524ce 100644
--- a/mullvad-management-interface/src/types/conversions/settings.rs
+++ b/mullvad-management-interface/src/types/conversions/settings.rs
@@ -57,6 +57,7 @@ impl From<&mullvad_types::settings::Settings> for proto::Settings {
.map(proto::RelayOverride::from)
.collect(),
recents: settings.recents.clone().map(proto::Recents::from),
+ update_default_location: settings.update_default_location,
}
}
}
@@ -203,6 +204,7 @@ impl TryFrom<proto::Settings> for mullvad_types::settings::Settings {
api_access_methods_settings,
)?,
recents: Some(vec![]),
+ update_default_location: settings.update_default_location,
})
}
}