summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2023-12-05 19:17:11 +0100
committerDavid Lönnhager <david.l@mullvad.net>2024-04-16 14:43:19 +0200
commit52a2bed28a4360d9c0f98fed2898e713dc85371c (patch)
treecd122d758e43fd5ea3982238ddaa6c5830b532ed /gui/src/main
parentee841c08bc6fa76e6147296ac43266aff963f5b8 (diff)
downloadmullvadvpn-52a2bed28a4360d9c0f98fed2898e713dc85371c.tar.xz
mullvadvpn-52a2bed28a4360d9c0f98fed2898e713dc85371c.zip
Add daita label to filters in location selector
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/daemon-rpc.ts37
1 files changed, 23 insertions, 14 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index 91c63d268c..ba913fea87 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -857,9 +857,7 @@ function convertFromRelayList(relayList: grpcTypes.RelayList): IRelayListWithEnd
relayList: {
countries: relayList
.getCountriesList()
- .map((country: grpcTypes.RelayListCountry) =>
- convertFromRelayListCountry(country.toObject()),
- ),
+ .map((country: grpcTypes.RelayListCountry) => convertFromRelayListCountry(country)),
},
wireguardEndpointData: convertWireguardEndpointData(relayList.getWireguard()!),
};
@@ -874,26 +872,37 @@ function convertWireguardEndpointData(
};
}
-function convertFromRelayListCountry(
- country: grpcTypes.RelayListCountry.AsObject,
-): IRelayListCountry {
+function convertFromRelayListCountry(country: grpcTypes.RelayListCountry): IRelayListCountry {
+ const countryObject = country.toObject();
return {
- ...country,
- cities: country.citiesList.map(convertFromRelayListCity),
+ ...countryObject,
+ cities: country.getCitiesList().map(convertFromRelayListCity),
};
}
-function convertFromRelayListCity(city: grpcTypes.RelayListCity.AsObject): IRelayListCity {
+function convertFromRelayListCity(city: grpcTypes.RelayListCity): IRelayListCity {
+ const cityObject = city.toObject();
return {
- ...city,
- relays: city.relaysList.map(convertFromRelayListRelay),
+ ...cityObject,
+ relays: city.getRelaysList().map(convertFromRelayListRelay),
};
}
-function convertFromRelayListRelay(relay: grpcTypes.Relay.AsObject): IRelayListHostname {
+function convertFromRelayListRelay(relay: grpcTypes.Relay): IRelayListHostname {
+ const relayObject = relay.toObject();
+
+ let daita = false;
+ if (relayObject.endpointType === grpcTypes.Relay.RelayType.WIREGUARD) {
+ const endpointDataU8 = relay.getEndpointData()?.getValue_asU8();
+ if (endpointDataU8) {
+ daita = grpcTypes.WireguardRelayEndpointData.deserializeBinary(endpointDataU8).getDaita();
+ }
+ }
+
return {
- ...relay,
- endpointType: convertFromRelayType(relay.endpointType),
+ ...relayObject,
+ endpointType: convertFromRelayType(relayObject.endpointType),
+ daita,
};
}