summaryrefslogtreecommitdiffhomepage
path: root/gui/src/shared
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2020-02-06 15:39:41 +0100
committerOskar Nyberg <oskar@mullvad.net>2020-02-06 15:45:39 +0100
commit8c7bc4426f7f97975356cbfa71d4014fae00c859 (patch)
treeda1b6f2161379a0f593709725dcdffcb8e242721 /gui/src/shared
parent033e58637a99a84a7ace29ff1c23bf7c3b456d48 (diff)
downloadmullvadvpn-8c7bc4426f7f97975356cbfa71d4014fae00c859.tar.xz
mullvadvpn-8c7bc4426f7f97975356cbfa71d4014fae00c859.zip
Pass function for reconnecting to TunnelControl
Diffstat (limited to 'gui/src/shared')
-rw-r--r--gui/src/shared/ipc-event-channel.ts5
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 a612660c99..5502a6698a 100644
--- a/gui/src/shared/ipc-event-channel.ts
+++ b/gui/src/shared/ipc-event-channel.ts
@@ -56,11 +56,13 @@ interface IReceiver<T> {
interface ITunnelMethods extends IReceiver<TunnelState> {
connect(): Promise<void>;
disconnect(): Promise<void>;
+ reconnect(): Promise<void>;
}
interface ITunnelHandlers extends ISender<TunnelState> {
handleConnect(fn: () => Promise<void>): void;
handleDisconnect(fn: () => Promise<void>): void;
+ handleReconnect(fn: () => Promise<void>): void;
}
interface ISettingsMethods extends IReceiver<ISettings> {
@@ -150,6 +152,7 @@ const DAEMON_DISCONNECTED = 'daemon-disconnected';
const TUNNEL_STATE_CHANGED = 'tunnel-state-changed';
const CONNECT_TUNNEL = 'connect-tunnel';
const DISCONNECT_TUNNEL = 'disconnect-tunnel';
+const RECONNECT_TUNNEL = 'reconnect-tunnel';
const SETTINGS_CHANGED = 'settings-changed';
const SET_ALLOW_LAN = 'set-allow-lan';
@@ -223,6 +226,7 @@ export class IpcRendererEventChannel {
listen: listen(TUNNEL_STATE_CHANGED),
connect: requestSender(CONNECT_TUNNEL),
disconnect: requestSender(DISCONNECT_TUNNEL),
+ reconnect: requestSender(RECONNECT_TUNNEL),
};
public static settings: ISettingsMethods = {
@@ -315,6 +319,7 @@ export class IpcMainEventChannel {
notify: sender(TUNNEL_STATE_CHANGED),
handleConnect: requestHandler(CONNECT_TUNNEL),
handleDisconnect: requestHandler(DISCONNECT_TUNNEL),
+ handleReconnect: requestHandler(RECONNECT_TUNNEL),
};
public static location: ISender<ILocation> = {