From 3485f5cda9ad93dd5110f5f61758396508744347 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:13:34 +0200 Subject: [PATCH] Fix: show boolean values in call (#553) --- packages/ui/src/components/CallInfo.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/components/CallInfo.tsx b/packages/ui/src/components/CallInfo.tsx index 3a1db40f..9458ea72 100644 --- a/packages/ui/src/components/CallInfo.tsx +++ b/packages/ui/src/components/CallInfo.tsx @@ -101,6 +101,9 @@ const handleBalanceDisplay = ({ ) } +const handleValueDisplay = ({ value, typeName }: { value: any; typeName: string | undefined }) => + typeName === 'bool' ? (value ? 'true' : 'false') : value + const getTypeName = (index: number, name: string, api: ApiPromise) => { const [pallet, method] = name.split('.') const metaArgs = !!pallet && !!method && api.tx[pallet][method]?.meta?.args @@ -153,7 +156,7 @@ const createUlTree = ({ name, args, decimals, unit, api, typeName }: CreateTreeP api, typeName: _typeName }) - : value} + : handleValueDisplay({ value, typeName: _typeName })} ) })}