summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorJonathan <jonathan@mullvad.net>2023-06-26 13:21:28 +0200
committerJonathan <jonathan@mullvad.net>2023-06-29 15:00:09 +0200
commitb4bf8124fbc30bf891f70f120265f30c490d1244 (patch)
tree8a747c315066a8d5b216ab471fadc022aa4aa4b8 /gui
parent2480e42126d54adfdeb6b70c475299ceac6718c9 (diff)
downloadmullvadvpn-b4bf8124fbc30bf891f70f120265f30c490d1244.tar.xz
mullvadvpn-b4bf8124fbc30bf891f70f120265f30c490d1244.zip
Cleanup review comments, CI issues and android support
Add necessary android support to allow it to not crash due to interface changes. Format the code, remove redundant async functions, fix android issues related to not having to use a Vec to store the custom lists and a string as an id. Fix unit tests.
Diffstat (limited to 'gui')
-rw-r--r--gui/src/main/daemon-rpc.ts20
1 files changed, 9 insertions, 11 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index e2a909b756..f4d47c7916 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -1232,21 +1232,19 @@ function convertFromLocation(location: grpcTypes.LocationConstraint.AsObject): R
// FIXME: This is a hack that assumes that the LocationConstraint is not a custom list.
// If it is we just set the country to "any" even if that isn't correct.
if (location.location == undefined) {
- return { country: "any" };
+ return { country: 'any' };
}
- else {
- const loc = location.location;
+ const loc = location.location;
- if (loc.hostname) {
- return { hostname: [loc.country, loc.city, loc.hostname] };
- }
-
- if (loc.city) {
- return { city: [loc.country, loc.city] };
- }
+ if (loc.hostname) {
+ return { hostname: [loc.country, loc.city, loc.hostname] };
+ }
- return { country: loc.country };
+ if (loc.city) {
+ return { city: [loc.country, loc.city] };
}
+
+ return { country: loc.country };
}
function convertFromTunnelOptions(tunnelOptions: grpcTypes.TunnelOptions.AsObject): ITunnelOptions {