Skip to content

Commit

Permalink
no cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarkhatov committed Aug 9, 2024
1 parent 4739984 commit 0309c2b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: ci
on:
pull_request:
branches:
- '**'
- "**"

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@v0.3.0
with:
run-build: true
run-unit-tests: true
run-unit-tests: true
8 changes: 4 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: docker_publish
on:
push:
branches:
- 'main'
- 'dev'
- "main"
- "dev"
tags:
- '*'
- "*"

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@v0.3.0
with:
run-build: true
run-unit-tests: true

docker_build:
needs: [lint_test]
runs-on: ubuntu-22.04
Expand Down
16 changes: 10 additions & 6 deletions src/app/components/Modals/ErrorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface ErrorModalProps {
errorMessage: string;
errorState?: ErrorState;
errorTime: Date;
noCancel?: boolean;
}

export const ErrorModal: React.FC<ErrorModalProps> = ({
Expand All @@ -20,6 +21,7 @@ export const ErrorModal: React.FC<ErrorModalProps> = ({
onRetry,
errorMessage,
errorState,
noCancel,
errorTime,
}) => {
const { error, retryErrorAction } = useError();
Expand Down Expand Up @@ -93,12 +95,14 @@ export const ErrorModal: React.FC<ErrorModalProps> = ({
<p className="text-center">{getErrorMessage()}</p>
</div>
<div className="mt-4 flex justify-around gap-4">
<button
className="btn btn-outline flex-1 rounded-lg px-2"
onClick={() => onClose()}
>
Cancel
</button>
{noCancel && (
<button
className="btn btn-outline flex-1 rounded-lg px-2"
onClick={() => onClose()}
>
Cancel
</button>
)}
{onRetry && (
<button
className="btn-primary btn flex-1 rounded-lg px-2 text-white"
Expand Down
8 changes: 7 additions & 1 deletion src/app/components/Staking/Staking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,13 @@ export const Staking: React.FC<StakingProps> = ({
errorState: ErrorState.STAKING,
errorTime: new Date(),
},
retryAction: handleSign,
noCancel: true,
retryAction: () => {
// in case of error, we need to reset the state
handleResetState();
// and refetch the UTXOs
queryClient.invalidateQueries({ queryKey: [UTXO_KEY, address] });
},
});
}
};
Expand Down
1 change: 1 addition & 0 deletions src/app/types/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ export interface ErrorHandlerParam {
export interface ShowErrorParams {
error: ErrorType;
retryAction?: () => void;
noCancel?: boolean;
}

0 comments on commit 0309c2b

Please sign in to comment.