Skip to content

Commit

Permalink
TransactionScreen: fix steps tooltip label
Browse files Browse the repository at this point in the history
  • Loading branch information
bpierre committed Jan 14, 2025
1 parent d53df11 commit 3457c23
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions frontend/app/src/screens/TransactionsScreen/TransactionsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,16 @@ export function TransactionsScreen() {

<FlowSteps
currentStep={currentStepIndex}
steps={flow.steps.map((step) => ({
error: step.error,
id: step.id,
label: flowParams ? stepDeclaration.name(flowParams) : "",
status: step.status,
}))}
steps={flow.steps.map((step) => {
const stepDeclaration = fd.steps[step.id];
const label = flowParams && stepDeclaration ? stepDeclaration.name(flowParams) : "";
return ({
error: step.error,
id: step.id,
label,
status: step.status,
});
})}
/>
</div>

Expand Down Expand Up @@ -390,13 +394,7 @@ function FlowSteps({
.otherwise(() => index === currentStep ? "Current step" : "Next step")}
mode={match(step.status)
.returnType<ComponentProps<typeof StepDisc>["mode"]>()
.with(
P.union(
"awaiting-commit",
"awaiting-verify",
),
() => "loading",
)
.with(P.union("awaiting-commit", "awaiting-verify"), () => "loading")
.with("confirmed", () => "success")
.with("error", () => "error")
.otherwise(() => index === currentStep ? "ready" : "upcoming")}
Expand Down

0 comments on commit 3457c23

Please sign in to comment.