summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-04-04 12:00:51 +0200
committerOskar Nyberg <oskar@mullvad.net>2022-04-04 12:00:51 +0200
commitadd9c8cc78029cf262a3dd6ef4e002fee648b199 (patch)
tree5db4272147d2396782af24de940c7839185867b4 /gui/src/main
parent600414493597fb49357becdf2616e453f726dd19 (diff)
parentd5385e0b7e66a75c3b4ed57fa000b0f03efebb39 (diff)
downloadmullvadvpn-add9c8cc78029cf262a3dd6ef4e002fee648b199.tar.xz
mullvadvpn-add9c8cc78029cf262a3dd6ef4e002fee648b199.zip
Merge branch 'stay-in-launch-view'
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/daemon-rpc.ts4
-rw-r--r--gui/src/main/index.ts6
2 files changed, 10 insertions, 0 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index 6e3fde5ea0..b57591c4af 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -513,6 +513,10 @@ export class DaemonRpc {
}
}
+ public async updateDevice(): Promise<void> {
+ await this.callEmpty(this.client.updateDevice);
+ }
+
public async listDevices(accountToken: AccountToken): Promise<Array<IDevice>> {
const response = await this.callString<grpcTypes.DeviceList>(
this.client.listDevices,
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 4ab0cbdd93..a47fa699df 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -198,6 +198,7 @@ class ApplicationMain {
},
};
private deviceConfig?: IDeviceConfig;
+ private hasReceivedDeviceConfig = false;
private guiSettings = new GuiSettings();
private tunnelStateExpectation?: Expectation;
@@ -647,6 +648,9 @@ class ApplicationMain {
// fetch device
try {
this.setDeviceConfig({ deviceConfig: await this.daemonRpc.getDevice() });
+ void this.daemonRpc
+ .updateDevice()
+ .catch((error: Error) => log.warn(`Failed to update device info: ${error.message}`));
} catch (e) {
const error = e as Error;
log.error(`Failed to fetch device: ${error.message}`);
@@ -1118,6 +1122,7 @@ class ApplicationMain {
private setDeviceConfig(deviceEvent: IDeviceEvent) {
const oldDeviceConfig = this.deviceConfig;
this.deviceConfig = deviceEvent.deviceConfig;
+ this.hasReceivedDeviceConfig = true;
// make sure to invalidate the account data cache when account tokens change
this.updateAccountDataOnAccountChange(
@@ -1214,6 +1219,7 @@ class ApplicationMain {
tunnelState: this.tunnelState,
settings: this.settings,
deviceConfig: this.deviceConfig,
+ hasReceivedDeviceConfig: this.hasReceivedDeviceConfig,
relayListPair: {
relays: this.processRelaysForPresentation(this.relays, this.settings.relaySettings),
bridges: this.processBridgesForPresentation(this.relays, this.settings.bridgeState),