summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-11-02 23:55:23 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-03-14 13:58:44 +0100
commit7c23c00a45d4a9342c69211d23ef8f8fd634725a (patch)
tree1b564ef7259db8f89ab333a2171ffc75577b5162 /gui/src/main
parentb43833503ba221d775e2f6196ad6e0dec0929756 (diff)
downloadmullvadvpn-7c23c00a45d4a9342c69211d23ef8f8fd634725a.tar.xz
mullvadvpn-7c23c00a45d4a9342c69211d23ef8f8fd634725a.zip
Replace use of setAccount with new calls
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/daemon-rpc.ts8
-rw-r--r--gui/src/main/index.ts4
2 files changed, 8 insertions, 4 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index 6f11a36100..e0c3c8bf60 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -255,8 +255,12 @@ export class DaemonRpc {
return response.getValue();
}
- public async setAccount(accountToken?: AccountToken): Promise<void> {
- await this.callString(this.client.setAccount, accountToken);
+ public async loginAccount(accountToken: AccountToken): Promise<void> {
+ await this.callString(this.client.loginAccount, accountToken);
+ }
+
+ public async logoutAccount(): Promise<void> {
+ await this.callEmpty(this.client.logoutAccount);
}
// TODO: Custom tunnel configurations are not supported by the GUI.
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 782e6d3982..774343b7aa 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -1436,7 +1436,7 @@ class ApplicationMain {
log.warn(`Failed to get account data, logging in anyway: ${verification.error.message}`);
}
- await this.daemonRpc.setAccount(accountToken);
+ await this.daemonRpc.loginAccount(accountToken);
} catch (e) {
const error = e as Error;
log.error(`Failed to login: ${error.message}`);
@@ -1475,7 +1475,7 @@ class ApplicationMain {
private async logout(): Promise<void> {
try {
- await this.daemonRpc.setAccount();
+ await this.daemonRpc.logoutAccount();
this.accountExpiryNotificationScheduler.cancel();
} catch (e) {