Skip to content

Commit 0309c2b

Browse files
committed
no cancel
1 parent 4739984 commit 0309c2b

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: ci
33
on:
44
pull_request:
55
branches:
6-
- '**'
6+
- "**"
77

88
jobs:
99
lint_test:
1010
uses: babylonlabs-io/.github/.github/workflows/[email protected]
1111
with:
1212
run-build: true
13-
run-unit-tests: true
13+
run-unit-tests: true

.github/workflows/publish.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ name: docker_publish
33
on:
44
push:
55
branches:
6-
- 'main'
7-
- 'dev'
6+
- "main"
7+
- "dev"
88
tags:
9-
- '*'
9+
- "*"
1010

1111
jobs:
1212
lint_test:
1313
uses: babylonlabs-io/.github/.github/workflows/[email protected]
1414
with:
1515
run-build: true
1616
run-unit-tests: true
17-
17+
1818
docker_build:
1919
needs: [lint_test]
2020
runs-on: ubuntu-22.04

src/app/components/Modals/ErrorModal.tsx

+10-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface ErrorModalProps {
1212
errorMessage: string;
1313
errorState?: ErrorState;
1414
errorTime: Date;
15+
noCancel?: boolean;
1516
}
1617

1718
export const ErrorModal: React.FC<ErrorModalProps> = ({
@@ -20,6 +21,7 @@ export const ErrorModal: React.FC<ErrorModalProps> = ({
2021
onRetry,
2122
errorMessage,
2223
errorState,
24+
noCancel,
2325
errorTime,
2426
}) => {
2527
const { error, retryErrorAction } = useError();
@@ -93,12 +95,14 @@ export const ErrorModal: React.FC<ErrorModalProps> = ({
9395
<p className="text-center">{getErrorMessage()}</p>
9496
</div>
9597
<div className="mt-4 flex justify-around gap-4">
96-
<button
97-
className="btn btn-outline flex-1 rounded-lg px-2"
98-
onClick={() => onClose()}
99-
>
100-
Cancel
101-
</button>
98+
{noCancel && (
99+
<button
100+
className="btn btn-outline flex-1 rounded-lg px-2"
101+
onClick={() => onClose()}
102+
>
103+
Cancel
104+
</button>
105+
)}
102106
{onRetry && (
103107
<button
104108
className="btn-primary btn flex-1 rounded-lg px-2 text-white"

src/app/components/Staking/Staking.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,13 @@ export const Staking: React.FC<StakingProps> = ({
286286
errorState: ErrorState.STAKING,
287287
errorTime: new Date(),
288288
},
289-
retryAction: handleSign,
289+
noCancel: true,
290+
retryAction: () => {
291+
// in case of error, we need to reset the state
292+
handleResetState();
293+
// and refetch the UTXOs
294+
queryClient.invalidateQueries({ queryKey: [UTXO_KEY, address] });
295+
},
290296
});
291297
}
292298
};

src/app/types/errors.ts

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ export interface ErrorHandlerParam {
2222
export interface ShowErrorParams {
2323
error: ErrorType;
2424
retryAction?: () => void;
25+
noCancel?: boolean;
2526
}

0 commit comments

Comments
 (0)