diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-11-02 23:55:23 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-03-14 13:58:44 +0100 |
| commit | 7c23c00a45d4a9342c69211d23ef8f8fd634725a (patch) | |
| tree | 1b564ef7259db8f89ab333a2171ffc75577b5162 /gui/src | |
| parent | b43833503ba221d775e2f6196ad6e0dec0929756 (diff) | |
| download | mullvadvpn-7c23c00a45d4a9342c69211d23ef8f8fd634725a.tar.xz mullvadvpn-7c23c00a45d4a9342c69211d23ef8f8fd634725a.zip | |
Replace use of setAccount with new calls
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 8 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 4 |
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) { |
