diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-02-25 13:56:23 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-04-03 13:36:43 +0200 |
| commit | 83d212b8cca484bd4b694e45e132341ca0c26768 (patch) | |
| tree | 852db24d05f71d440983a17b2e72c6ac47726973 /gui/src/shared | |
| parent | ba31bee6e84bea28ee0e01cf4da414b15826f985 (diff) | |
| download | mullvadvpn-83d212b8cca484bd4b694e45e132341ca0c26768.tar.xz mullvadvpn-83d212b8cca484bd4b694e45e132341ca0c26768.zip | |
Create new account when pressing create account button
Diffstat (limited to 'gui/src/shared')
| -rw-r--r-- | gui/src/shared/ipc-event-channel.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gui/src/shared/ipc-event-channel.ts b/gui/src/shared/ipc-event-channel.ts index 9931ecf56b..5268415bfa 100644 --- a/gui/src/shared/ipc-event-channel.ts +++ b/gui/src/shared/ipc-event-channel.ts @@ -106,12 +106,14 @@ interface IGuiSettingsHandlers extends ISender<IGuiSettingsState> { } interface IAccountHandlers extends ISender<IAccountData | undefined> { + handleCreate(fn: () => Promise<string>): void; handleLogin(fn: (token: AccountToken) => Promise<void>): void; handleLogout(fn: () => Promise<void>): void; handleWwwAuthToken(fn: () => Promise<string>): void; } interface IAccountMethods extends IReceiver<IAccountData | undefined> { + create(): Promise<string>; login(token: AccountToken): Promise<void>; logout(): Promise<void>; getWwwAuthToken(): Promise<string>; @@ -186,6 +188,7 @@ const GET_APP_STATE = 'get-app-state'; const ACCOUNT_HISTORY_CHANGED = 'account-history-changed'; const REMOVE_ACCOUNT_HISTORY_ITEM = 'remove-account-history-item'; +const CREATE_NEW_ACCOUNT = 'create-new-account'; const DO_LOGIN = 'do-login'; const DO_LOGOUT = 'do-logout'; const DO_GET_WWW_AUTH_TOKEN = 'do-get-www-auth-token'; @@ -280,6 +283,7 @@ export class IpcRendererEventChannel { public static account: IAccountMethods = { listen: listen(ACCOUNT_DATA_CHANGED), + create: requestSender(CREATE_NEW_ACCOUNT), login: requestSender(DO_LOGIN), logout: requestSender(DO_LOGOUT), getWwwAuthToken: requestSender(DO_GET_WWW_AUTH_TOKEN), @@ -375,6 +379,7 @@ export class IpcMainEventChannel { public static account: IAccountHandlers = { notify: sender<IAccountData | undefined>(ACCOUNT_DATA_CHANGED), + handleCreate: requestHandler(CREATE_NEW_ACCOUNT), handleLogin: requestHandler(DO_LOGIN), handleLogout: requestHandler(DO_LOGOUT), handleWwwAuthToken: requestHandler(DO_GET_WWW_AUTH_TOKEN), |
