diff options
| author | Emīls <emils@mullvad.net> | 2019-12-09 11:24:37 +0000 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2019-12-09 11:24:37 +0000 |
| commit | be89341733b58f2e992141fe99713e4d6e4ba7fd (patch) | |
| tree | 5c5c7413fab96d3c874cc882b7f80e253892cef0 /gui/src/main | |
| parent | 345bebcf9cd75dc29328b1355c2feacbf7b65aad (diff) | |
| parent | 3a041298b1433ec8b81656d77bc2379978af2691 (diff) | |
| download | mullvadvpn-be89341733b58f2e992141fe99713e4d6e4ba7fd.tar.xz mullvadvpn-be89341733b58f2e992141fe99713e4d6e4ba7fd.zip | |
Merge branch 'add-error-state'
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 55 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 12 | ||||
| -rw-r--r-- | gui/src/main/notification-controller.ts | 21 |
3 files changed, 43 insertions, 45 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 5fcc9171e0..78748b70ab 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -251,32 +251,35 @@ const tunnelStateSchema = oneOf( }), }), object({ - state: enumeration('blocked'), - details: oneOf( - object({ - reason: enumeration( - 'ipv6_unavailable', - 'set_firewall_policy_error', - 'set_dns_error', - 'start_tunnel_error', - 'is_offline', - 'tap_adapter_problem', - ), - }), - object({ - reason: enumeration('auth_failed'), - details: maybe(string), - }), - object({ - reason: enumeration('tunnel_parameter_error'), - details: enumeration( - 'no_matching_relay', - 'no_matching_bridge_relay', - 'no_wireguard_key', - 'custom_tunnel_host_resultion_error', - ), - }), - ), + state: enumeration('error'), + details: object({ + is_blocking: boolean, + cause: oneOf( + object({ + reason: enumeration( + 'ipv6_unavailable', + 'set_firewall_policy_error', + 'set_dns_error', + 'start_tunnel_error', + 'is_offline', + 'tap_adapter_problem', + ), + }), + object({ + reason: enumeration('auth_failed'), + details: maybe(string), + }), + object({ + reason: enumeration('tunnel_parameter_error'), + details: enumeration( + 'no_matching_relay', + 'no_matching_bridge_relay', + 'no_wireguard_key', + 'custom_tunnel_host_resultion_error', + ), + }), + ), + }), }), object({ state: enumeration('connected', 'connecting', 'disconnected'), diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index cba1caac5a..0ef641ec15 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -851,14 +851,12 @@ class ApplicationMain { case 'connecting': return 'securing'; - case 'blocked': - switch (tunnelState.details.reason) { - case 'set_firewall_policy_error': - return 'unsecured'; - default: - return 'securing'; + case 'error': + if (tunnelState.details.isBlocking) { + return 'securing'; + } else { + return 'unsecured'; } - case 'disconnecting': return 'securing'; diff --git a/gui/src/main/notification-controller.ts b/gui/src/main/notification-controller.ts index 515918f50c..99af3bcf45 100644 --- a/gui/src/main/notification-controller.ts +++ b/gui/src/main/notification-controller.ts @@ -75,18 +75,15 @@ export default class NotificationController { case 'disconnected': this.showTunnelStateNotification(messages.pgettext('notifications', 'Unsecured')); break; - case 'blocked': - switch (tunnelState.details.reason) { - case 'set_firewall_policy_error': - this.showTunnelStateNotification( - messages.pgettext('notifications', 'Critical failure - Unsecured'), - ); - break; - default: - this.showTunnelStateNotification( - messages.pgettext('notifications', 'Blocked all connections'), - ); - break; + case 'error': + if (tunnelState.details.isBlocking) { + this.showTunnelStateNotification( + messages.pgettext('notifications', 'Blocked all connections'), + ); + } else { + this.showTunnelStateNotification( + messages.pgettext('notifications', 'Critical failure - Unsecured'), + ); } break; case 'disconnecting': |
