summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/renderer')
-rw-r--r--gui/src/renderer/app.tsx2
-rw-r--r--gui/src/renderer/components/Connect.tsx2
-rw-r--r--gui/src/renderer/components/HeaderBar.tsx2
-rw-r--r--gui/src/renderer/components/MainView.tsx11
-rw-r--r--gui/src/renderer/components/NotificationArea.tsx2
-rw-r--r--gui/src/renderer/components/TunnelControl.tsx2
-rw-r--r--gui/src/renderer/redux/connection/actions.ts6
7 files changed, 16 insertions, 11 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index ae7cdec881..e78462041b 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -754,7 +754,7 @@ export default class AppRenderer {
break;
case 'error':
- actions.updateBlockState(!tunnelState.details.blockFailure);
+ actions.updateBlockState(!tunnelState.details.blockingError);
break;
}
}
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>
diff --git a/gui/src/renderer/redux/connection/actions.ts b/gui/src/renderer/redux/connection/actions.ts
index 20c63d433d..35af568fb2 100644
--- a/gui/src/renderer/redux/connection/actions.ts
+++ b/gui/src/renderer/redux/connection/actions.ts
@@ -1,6 +1,6 @@
import {
AfterDisconnect,
- IErrorState,
+ ErrorState,
ILocation,
ITunnelStateRelayInfo,
} from '../../../shared/daemon-rpc-types';
@@ -26,7 +26,7 @@ interface IDisconnectingAction {
interface IBlockedAction {
type: 'TUNNEL_ERROR';
- errorState: IErrorState;
+ errorState: ErrorState;
}
interface INewLocationAction {
@@ -75,7 +75,7 @@ function disconnecting(afterDisconnect: AfterDisconnect): IDisconnectingAction {
};
}
-function blocked(errorState: IErrorState): IBlockedAction {
+function blocked(errorState: ErrorState): IBlockedAction {
return {
type: 'TUNNEL_ERROR',
errorState,