Skip to content

Commit

Permalink
feat: remove error timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
totraev committed Sep 12, 2024
1 parent 0d66733 commit 0d70c7f
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 18 deletions.
2 changes: 0 additions & 2 deletions src/app/components/Delegations/Delegations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const Delegations: React.FC<DelegationsProps> = ({
error: {
message: error.message,
errorState: ErrorState.UNBONDING,
errorTime: new Date(),
},
retryAction: () => handleModal(id, MODE_UNBOND),
});
Expand Down Expand Up @@ -156,7 +155,6 @@ export const Delegations: React.FC<DelegationsProps> = ({
error: {
message: error.message,
errorState: ErrorState.WITHDRAW,
errorTime: new Date(),
},
retryAction: () => handleModal(id, MODE_WITHDRAW),
});
Expand Down
3 changes: 0 additions & 3 deletions src/app/components/Modals/ErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ interface ErrorModalProps {
onRetry?: () => void;
errorMessage: string;
errorState?: ErrorState;
errorTime: Date;
noCancel?: boolean;
}

Expand All @@ -22,7 +21,6 @@ export const ErrorModal: React.FC<ErrorModalProps> = ({
errorMessage,
errorState,
noCancel,
// errorTime, // This prop is not used in the component
}) => {
const { error, retryErrorAction } = useError();

Expand All @@ -31,7 +29,6 @@ export const ErrorModal: React.FC<ErrorModalProps> = ({
error: {
message: error.message,
errorState: error.errorState,
errorTime: new Date(),
},
retryAction: retryErrorAction,
};
Expand Down
1 change: 0 additions & 1 deletion src/app/components/Stakers/Stakers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const Stakers: React.FC<StakersProps> = () => {
error: {
message: error.message,
errorState: ErrorState.SERVER_ERROR,
errorTime: new Date(),
},
retryAction: refetch,
});
Expand Down
4 changes: 0 additions & 4 deletions src/app/components/Staking/Staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ export const Staking: React.FC<StakingProps> = ({
error: {
message: error.message,
errorState,
errorTime: new Date(),
},
retryAction: refetchFunction,
});
Expand Down Expand Up @@ -281,7 +280,6 @@ export const Staking: React.FC<StakingProps> = ({
error: {
message: error.message,
errorState: ErrorState.STAKING,
errorTime: new Date(),
},
noCancel: true,
retryAction: () => {
Expand Down Expand Up @@ -377,7 +375,6 @@ export const Staking: React.FC<StakingProps> = ({
error: {
message: errorMsg,
errorState: ErrorState.STAKING,
errorTime: new Date(),
},
retryAction: () => setSelectedFeeRate(0),
});
Expand Down Expand Up @@ -426,7 +423,6 @@ export const Staking: React.FC<StakingProps> = ({
error: {
message: error.message,
errorState: ErrorState.STAKING,
errorTime: new Date(),
},
retryAction: () => handleChooseFinalityProvider(btcPkHex),
});
Expand Down
3 changes: 0 additions & 3 deletions src/app/context/Error/ErrorContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export const ErrorProvider: React.FC<ErrorProviderProps> = ({ children }) => {
const [isNoCancel, setIsNoCancel] = useState(false);
const [error, setError] = useState<ErrorType>({
message: "",
errorTime: new Date(),
errorState: undefined,
});
const [retryErrorAction, setRetryErrorAction] = useState<
Expand All @@ -60,7 +59,6 @@ export const ErrorProvider: React.FC<ErrorProviderProps> = ({ children }) => {
setTimeout(() => {
setError({
message: "",
errorTime: new Date(),
errorState: undefined,
});
setRetryErrorAction(undefined);
Expand All @@ -75,7 +73,6 @@ export const ErrorProvider: React.FC<ErrorProviderProps> = ({ children }) => {
error: {
message: error.message,
errorState: errorState,
errorTime: new Date(),
},
retryAction: refetchFunction,
});
Expand Down
1 change: 0 additions & 1 deletion src/app/context/api/StakingStatsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export const StakingStatsProvider: React.FC<StakingStatsProviderProps> = ({
error: {
message: error.message,
errorState: ErrorState.SERVER_ERROR,
errorTime: new Date(),
},
retryAction: refetch,
});
Expand Down
1 change: 0 additions & 1 deletion src/app/hooks/useHealthCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const useHealthCheck = () => {
error: {
message: error.message,
errorState: ErrorState.SERVER_ERROR,
errorTime: new Date(),
},
retryAction: refetch,
});
Expand Down
2 changes: 0 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ const Home: React.FC<HomeProps> = () => {
error: {
message: errorMessage,
errorState: ErrorState.WALLET,
errorTime: new Date(),
},
retryAction: () => handleConnectBTC(walletProvider),
});
Expand Down Expand Up @@ -391,7 +390,6 @@ const Home: React.FC<HomeProps> = () => {
open={isErrorOpen}
errorMessage={error.message}
errorState={error.errorState}
errorTime={error.errorTime}
onClose={hideError}
onRetry={retryErrorAction}
noCancel={noCancel}
Expand Down
1 change: 0 additions & 1 deletion src/app/types/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export enum ErrorState {
export interface ErrorType {
message: string;
errorState?: ErrorState;
errorTime: Date;
}

export interface ErrorHandlerParam {
Expand Down

0 comments on commit 0d70c7f

Please sign in to comment.