From 3457c23eface53d3d7e208cd3278846533791828 Mon Sep 17 00:00:00 2001 From: Pierre Bertet Date: Tue, 14 Jan 2025 10:28:42 +0000 Subject: [PATCH] TransactionScreen: fix steps tooltip label --- .../TransactionsScreen/TransactionsScreen.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/frontend/app/src/screens/TransactionsScreen/TransactionsScreen.tsx b/frontend/app/src/screens/TransactionsScreen/TransactionsScreen.tsx index b907e962e..4f473238d 100644 --- a/frontend/app/src/screens/TransactionsScreen/TransactionsScreen.tsx +++ b/frontend/app/src/screens/TransactionsScreen/TransactionsScreen.tsx @@ -164,12 +164,16 @@ export function TransactionsScreen() { ({ - 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, + }); + })} /> @@ -390,13 +394,7 @@ function FlowSteps({ .otherwise(() => index === currentStep ? "Current step" : "Next step")} mode={match(step.status) .returnType["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")}