From 0d70c7f72cc8721b0aff3ac05cfc738c31670eda Mon Sep 17 00:00:00 2001 From: David Totraev Date: Thu, 12 Sep 2024 18:00:31 +0500 Subject: [PATCH] feat: remove error timestamp --- src/app/components/Delegations/Delegations.tsx | 2 -- src/app/components/Modals/ErrorModal.tsx | 3 --- src/app/components/Stakers/Stakers.tsx | 1 - src/app/components/Staking/Staking.tsx | 4 ---- src/app/context/Error/ErrorContext.tsx | 3 --- src/app/context/api/StakingStatsProvider.tsx | 1 - src/app/hooks/useHealthCheck.ts | 1 - src/app/page.tsx | 2 -- src/app/types/errors.ts | 1 - 9 files changed, 18 deletions(-) diff --git a/src/app/components/Delegations/Delegations.tsx b/src/app/components/Delegations/Delegations.tsx index bf2f7e96..4baed658 100644 --- a/src/app/components/Delegations/Delegations.tsx +++ b/src/app/components/Delegations/Delegations.tsx @@ -123,7 +123,6 @@ export const Delegations: React.FC = ({ error: { message: error.message, errorState: ErrorState.UNBONDING, - errorTime: new Date(), }, retryAction: () => handleModal(id, MODE_UNBOND), }); @@ -156,7 +155,6 @@ export const Delegations: React.FC = ({ error: { message: error.message, errorState: ErrorState.WITHDRAW, - errorTime: new Date(), }, retryAction: () => handleModal(id, MODE_WITHDRAW), }); diff --git a/src/app/components/Modals/ErrorModal.tsx b/src/app/components/Modals/ErrorModal.tsx index 20331e28..62c91fc7 100644 --- a/src/app/components/Modals/ErrorModal.tsx +++ b/src/app/components/Modals/ErrorModal.tsx @@ -11,7 +11,6 @@ interface ErrorModalProps { onRetry?: () => void; errorMessage: string; errorState?: ErrorState; - errorTime: Date; noCancel?: boolean; } @@ -22,7 +21,6 @@ export const ErrorModal: React.FC = ({ errorMessage, errorState, noCancel, - // errorTime, // This prop is not used in the component }) => { const { error, retryErrorAction } = useError(); @@ -31,7 +29,6 @@ export const ErrorModal: React.FC = ({ error: { message: error.message, errorState: error.errorState, - errorTime: new Date(), }, retryAction: retryErrorAction, }; diff --git a/src/app/components/Stakers/Stakers.tsx b/src/app/components/Stakers/Stakers.tsx index d4068422..eaec8393 100644 --- a/src/app/components/Stakers/Stakers.tsx +++ b/src/app/components/Stakers/Stakers.tsx @@ -35,7 +35,6 @@ export const Stakers: React.FC = () => { error: { message: error.message, errorState: ErrorState.SERVER_ERROR, - errorTime: new Date(), }, retryAction: refetch, }); diff --git a/src/app/components/Staking/Staking.tsx b/src/app/components/Staking/Staking.tsx index 12f9cb65..a5f0b9f0 100644 --- a/src/app/components/Staking/Staking.tsx +++ b/src/app/components/Staking/Staking.tsx @@ -206,7 +206,6 @@ export const Staking: React.FC = ({ error: { message: error.message, errorState, - errorTime: new Date(), }, retryAction: refetchFunction, }); @@ -281,7 +280,6 @@ export const Staking: React.FC = ({ error: { message: error.message, errorState: ErrorState.STAKING, - errorTime: new Date(), }, noCancel: true, retryAction: () => { @@ -377,7 +375,6 @@ export const Staking: React.FC = ({ error: { message: errorMsg, errorState: ErrorState.STAKING, - errorTime: new Date(), }, retryAction: () => setSelectedFeeRate(0), }); @@ -426,7 +423,6 @@ export const Staking: React.FC = ({ error: { message: error.message, errorState: ErrorState.STAKING, - errorTime: new Date(), }, retryAction: () => handleChooseFinalityProvider(btcPkHex), }); diff --git a/src/app/context/Error/ErrorContext.tsx b/src/app/context/Error/ErrorContext.tsx index 9582113b..0b6eb942 100644 --- a/src/app/context/Error/ErrorContext.tsx +++ b/src/app/context/Error/ErrorContext.tsx @@ -38,7 +38,6 @@ export const ErrorProvider: React.FC = ({ children }) => { const [isNoCancel, setIsNoCancel] = useState(false); const [error, setError] = useState({ message: "", - errorTime: new Date(), errorState: undefined, }); const [retryErrorAction, setRetryErrorAction] = useState< @@ -60,7 +59,6 @@ export const ErrorProvider: React.FC = ({ children }) => { setTimeout(() => { setError({ message: "", - errorTime: new Date(), errorState: undefined, }); setRetryErrorAction(undefined); @@ -75,7 +73,6 @@ export const ErrorProvider: React.FC = ({ children }) => { error: { message: error.message, errorState: errorState, - errorTime: new Date(), }, retryAction: refetchFunction, }); diff --git a/src/app/context/api/StakingStatsProvider.tsx b/src/app/context/api/StakingStatsProvider.tsx index 63f1fa22..070ca3b8 100644 --- a/src/app/context/api/StakingStatsProvider.tsx +++ b/src/app/context/api/StakingStatsProvider.tsx @@ -51,7 +51,6 @@ export const StakingStatsProvider: React.FC = ({ error: { message: error.message, errorState: ErrorState.SERVER_ERROR, - errorTime: new Date(), }, retryAction: refetch, }); diff --git a/src/app/hooks/useHealthCheck.ts b/src/app/hooks/useHealthCheck.ts index 63b45219..579f7c6e 100644 --- a/src/app/hooks/useHealthCheck.ts +++ b/src/app/hooks/useHealthCheck.ts @@ -26,7 +26,6 @@ export const useHealthCheck = () => { error: { message: error.message, errorState: ErrorState.SERVER_ERROR, - errorTime: new Date(), }, retryAction: refetch, }); diff --git a/src/app/page.tsx b/src/app/page.tsx index e99f2b9e..acdeab8b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -253,7 +253,6 @@ const Home: React.FC = () => { error: { message: errorMessage, errorState: ErrorState.WALLET, - errorTime: new Date(), }, retryAction: () => handleConnectBTC(walletProvider), }); @@ -391,7 +390,6 @@ const Home: React.FC = () => { open={isErrorOpen} errorMessage={error.message} errorState={error.errorState} - errorTime={error.errorTime} onClose={hideError} onRetry={retryErrorAction} noCancel={noCancel} diff --git a/src/app/types/errors.ts b/src/app/types/errors.ts index 7080274e..6a032b1b 100644 --- a/src/app/types/errors.ts +++ b/src/app/types/errors.ts @@ -9,7 +9,6 @@ export enum ErrorState { export interface ErrorType { message: string; errorState?: ErrorState; - errorTime: Date; } export interface ErrorHandlerParam {