diff options
Diffstat (limited to 'gui/src/renderer')
| -rw-r--r-- | gui/src/renderer/components/NotificationArea.tsx | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx index fcd0872c2e..78cc013f4d 100644 --- a/gui/src/renderer/components/NotificationArea.tsx +++ b/gui/src/renderer/components/NotificationArea.tsx @@ -14,7 +14,7 @@ import { NotificationTitle, } from './NotificationBanner'; -import { BlockReason, TunnelState } from '../../shared/daemon-rpc-types'; +import { BlockReason, TunnelParameterError, TunnelState } from '../../shared/daemon-rpc-types'; import AccountExpiry from '../lib/account-expiry'; import { parseAuthFailure } from '../lib/auth-failure'; import { IVersionReduxState } from '../redux/version/reducers'; @@ -40,6 +40,29 @@ type State = NotificationAreaPresentation & { visible: boolean; }; +function getTunnelParameterMessage(err: TunnelParameterError): string { + switch (err) { + /// TODO: once bridge constraints can be set, add a more descriptive error message + case 'no_matching_bridge_relay': + case 'no_matching_relay': + return messages.pgettext( + 'in-app-notifications', + 'No relay server matches the current settings. You can try changing the location or the relay settings.', + ); + case 'no_wireguard_key': + return messages.pgettext( + 'in-app-notifications', + 'WireGuard key not set. You can generate one manually in the advanced settings.', + ); + break; + case 'custom_tunnel_host_resultion_error': + return messages.pgettext( + 'in-app-notifications', + 'Failed to resolve host of custom tunnel. Consider changing the settings', + ); + } +} + function getBlockReasonMessage(blockReason: BlockReason): string { switch (blockReason.reason) { case 'auth_failed': @@ -70,11 +93,8 @@ function getBlockReasonMessage(blockReason: BlockReason): string { return messages.pgettext('in-app-notifications', 'Failed to set system DNS server'); case 'start_tunnel_error': return messages.pgettext('in-app-notifications', 'Failed to start tunnel connection'); - case 'no_matching_relay': - return messages.pgettext( - 'in-app-notifications', - 'No relay server matches the current settings. You can try changing the location or the relay settings.', - ); + case 'tunnel_parameter_error': + return getTunnelParameterMessage(blockReason.details); case 'is_offline': return messages.pgettext( 'in-app-notifications', |
