From 2db0e8a61b4da2d59d151b733bdf7fba3760e48c Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:11:07 +0100 Subject: [PATCH] Hotfix for pallet method undefined (#405) --- packages/ui/src/components/CallInfo.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/CallInfo.tsx b/packages/ui/src/components/CallInfo.tsx index ef2910f6..788b5fe9 100644 --- a/packages/ui/src/components/CallInfo.tsx +++ b/packages/ui/src/components/CallInfo.tsx @@ -104,7 +104,7 @@ const handleBalanceDisplay = ({ const getTypeName = (index: number, name: string, api: ApiPromise) => { const [pallet, method] = name.split('.') - const metaArgs = !!pallet && !!method && api.tx[pallet][method].meta.args + const metaArgs = !!pallet && !!method && api.tx[pallet][method]?.meta?.args return ( (!!metaArgs && metaArgs[index] && (metaArgs[index].toHuman().typeName as string)) || undefined @@ -125,7 +125,7 @@ const createUlTree = ({ name, args, decimals, unit, api, typeName }: CreateTreeP } if (_typeName === 'RuntimeCall') { - return handleCallDisplay({ call: value, decimals, unit, api, key: `${key}` }) + return handleCallDisplay({ call: value, decimals, unit, api, key: `${key}-call` }) } // generically show nice value for Balance type