diff options
Diffstat (limited to 'gui/src/renderer/components')
| -rw-r--r-- | gui/src/renderer/components/Connect.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/HeaderBar.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/MainView.tsx | 11 | ||||
| -rw-r--r-- | gui/src/renderer/components/NotificationArea.tsx | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/TunnelControl.tsx | 2 |
5 files changed, 12 insertions, 7 deletions
diff --git a/gui/src/renderer/components/Connect.tsx b/gui/src/renderer/components/Connect.tsx index 492fcc3fc9..79de3c5242 100644 --- a/gui/src/renderer/components/Connect.tsx +++ b/gui/src/renderer/components/Connect.tsx @@ -97,7 +97,7 @@ export default function Connect() { case 'connected': return MarkerStyle.secure; case 'error': - return !connection.status.details.blockFailure ? MarkerStyle.secure : MarkerStyle.unsecure; + return !connection.status.details.blockingError ? MarkerStyle.secure : MarkerStyle.unsecure; case 'disconnected': return MarkerStyle.unsecure; case 'disconnecting': diff --git a/gui/src/renderer/components/HeaderBar.tsx b/gui/src/renderer/components/HeaderBar.tsx index 3cf96df6fc..7c436e3c16 100644 --- a/gui/src/renderer/components/HeaderBar.tsx +++ b/gui/src/renderer/components/HeaderBar.tsx @@ -139,7 +139,7 @@ export function calculateHeaderBarStyle(tunnelState: TunnelState): HeaderBarStyl case 'connected': return HeaderBarStyle.success; case 'error': - return !tunnelState.details.blockFailure ? HeaderBarStyle.success : HeaderBarStyle.error; + return !tunnelState.details.blockingError ? HeaderBarStyle.success : HeaderBarStyle.error; case 'disconnecting': switch (tunnelState.details) { case 'block': diff --git a/gui/src/renderer/components/MainView.tsx b/gui/src/renderer/components/MainView.tsx index cc2419ddfd..983a33d376 100644 --- a/gui/src/renderer/components/MainView.tsx +++ b/gui/src/renderer/components/MainView.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react'; import { hasExpired } from '../../shared/account-expiry'; +import { AuthFailedError, ErrorStateCause } from '../../shared/daemon-rpc-types'; import Connect from '../components/Connect'; import { useHistory } from '../lib/history'; import { RoutePath } from '../lib/routes'; @@ -16,6 +17,7 @@ export default function MainView() { const isNewAccount = useSelector( (state) => state.account.status.type === 'ok' && state.account.status.method === 'new_account', ); + const tunnelState = useSelector((state) => state.connection.status); const [showAccountExpired, setShowAccountExpired] = useState<ExpiryData>(() => isNewAccount || accountHasExpired ? { show: true, expiry: accountExpiry } : { show: false }, @@ -23,8 +25,11 @@ export default function MainView() { useEffect(() => { if ( - accountHasExpired && - (!showAccountExpired.show || showAccountExpired.expiry !== accountExpiry) + (!showAccountExpired.show || showAccountExpired.expiry !== accountExpiry) && + (accountHasExpired || + (tunnelState.state === 'error' && + tunnelState.details.cause === ErrorStateCause.authFailed && + tunnelState.details.authFailedError === AuthFailedError.expiredAccount)) ) { setShowAccountExpired({ show: true, expiry: accountExpiry }); } else if ( @@ -34,7 +39,7 @@ export default function MainView() { ) { history.push(RoutePath.timeAdded); } - }, [showAccountExpired, accountHasExpired]); + }, [showAccountExpired, accountHasExpired, tunnelState.state]); if (showAccountExpired.show) { return <ExpiredAccountErrorView />; diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx index acd1aaf2df..317cc1e923 100644 --- a/gui/src/renderer/components/NotificationArea.tsx +++ b/gui/src/renderer/components/NotificationArea.tsx @@ -51,7 +51,7 @@ export default function NotificationArea(props: IProps) { blockWhenDisconnected, hasExcludedApps, }), - new ErrorNotificationProvider({ tunnelState, accountExpiry, hasExcludedApps }), + new ErrorNotificationProvider({ tunnelState, hasExcludedApps }), new InconsistentVersionNotificationProvider({ consistent: version.consistent }), new UnsupportedVersionNotificationProvider(version), ]; diff --git a/gui/src/renderer/components/TunnelControl.tsx b/gui/src/renderer/components/TunnelControl.tsx index db0503cb0a..c9fd568a3f 100644 --- a/gui/src/renderer/components/TunnelControl.tsx +++ b/gui/src/renderer/components/TunnelControl.tsx @@ -139,7 +139,7 @@ export default class TunnelControl extends React.Component<ITunnelControlProps> case 'error': if ( this.props.tunnelState.state === 'error' && - this.props.tunnelState.details.blockFailure + this.props.tunnelState.details.blockingError ) { return ( <Wrapper> |
