summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-07-19 11:45:38 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-08-17 08:40:52 +0200
commitac6e37692d40f2209191b0bb8d2bcac4b51de377 (patch)
tree965ad218649ff070a4eafa1843272946ee1f73cd /gui/src/main
parent7995fe3a3a042b1fcde04d72b4d8cea0e5f93984 (diff)
downloadmullvadvpn-ac6e37692d40f2209191b0bb8d2bcac4b51de377.tar.xz
mullvadvpn-ac6e37692d40f2209191b0bb8d2bcac4b51de377.zip
Add provider to daemon rpc types
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/daemon-rpc.ts11
-rw-r--r--gui/src/main/index.ts2
2 files changed, 13 insertions, 0 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index 28b8e651dc..1c3e9a67ba 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -293,6 +293,12 @@ export class DaemonRpc {
);
}
+ if (settingsUpdate.providers) {
+ const providerUpdate = new grpcTypes.ProviderUpdate();
+ providerUpdate.setProvidersList(settingsUpdate.providers);
+ normalUpdate.setProviders(providerUpdate);
+ }
+
grpcRelaySettings.setNormal(normalUpdate);
await this.call<grpcTypes.RelaySettingsUpdate, Empty>(
this.client.updateRelaySettings,
@@ -924,6 +930,7 @@ function convertFromRelaySettings(
? { only: convertFromLocation(grpcLocation.toObject()) }
: 'any';
const tunnelProtocol = convertFromTunnelTypeConstraint(normal.getTunnelType()!);
+ const providers = normal.getProvidersList();
const openvpnConstraints = convertFromOpenVpnConstraints(normal.getOpenvpnConstraints()!);
const wireguardConstraints = convertFromWireguardConstraints(
normal.getWireguardConstraints()!,
@@ -933,6 +940,7 @@ function convertFromRelaySettings(
normal: {
location,
tunnelProtocol,
+ providers,
wireguardConstraints,
openvpnConstraints,
},
@@ -951,9 +959,11 @@ function convertFromBridgeSettings(
if (normalSettings) {
const grpcLocation = normalSettings.location;
const location = grpcLocation ? { only: convertFromLocation(grpcLocation) } : 'any';
+ const providers = normalSettings.providersList;
return {
normal: {
location,
+ providers,
},
};
}
@@ -1177,6 +1187,7 @@ function convertToNormalBridgeSettings(
): grpcTypes.BridgeSettings.BridgeConstraints {
const normalBridgeSettings = new grpcTypes.BridgeSettings.BridgeConstraints();
normalBridgeSettings.setLocation(convertToLocation(liftConstraint(constraints.location)));
+ normalBridgeSettings.setProvidersList(constraints.providers);
return normalBridgeSettings;
}
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index a81324fd27..95771c5878 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -136,6 +136,7 @@ class ApplicationMain {
normal: {
location: 'any',
tunnelProtocol: 'any',
+ providers: [],
openvpnConstraints: {
port: 'any',
protocol: 'any',
@@ -148,6 +149,7 @@ class ApplicationMain {
bridgeSettings: {
normal: {
location: 'any',
+ providers: [],
},
},
bridgeState: 'auto',