Skip to content

Commit

Permalink
Fix value is null (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbaut authored Oct 12, 2023
1 parent 29908c9 commit 499b33f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/components/CallInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ const handleBalanceDisplay = ({

const getTypeName = (index: number, name: string, value: any, api: ApiPromise) => {
const [palletFromName, methodFromName] = name.split('.')
const pallet = value.section || palletFromName
const method = value.method || methodFromName
const pallet = value?.section || palletFromName
const method = value?.method || methodFromName
const metaArgs = !!pallet && !!method && api.tx[pallet][method].meta.args

return (
Expand Down
12 changes: 5 additions & 7 deletions packages/ui/src/components/EasySetup/FromCallData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const FromCallData = ({ className, onSetExtrinsic, isProxySelected, onSetErrorMe
setIsProxyProxyRemoved(false)
if (!api) return call

if (!isProxySelected) return call

const proxyProxyString = u8aToHex(api?.tx.proxy?.proxy.callIndex).toString()

// check if this call is a proxy.proxy
Expand All @@ -46,7 +44,7 @@ const FromCallData = ({ className, onSetExtrinsic, isProxySelected, onSetErrorMe
setIsProxyProxyRemoved(true)
return `0x${call.substring(74)}` as HexString
},
[api, isProxySelected]
[api]
)

// users may erroneously paste callData from the multisig calldata
Expand Down Expand Up @@ -106,12 +104,12 @@ const FromCallData = ({ className, onSetExtrinsic, isProxySelected, onSetErrorMe
error={!!callDataError}
fullWidth
/>
{!!pastedCallData && !!pastedCallInfo && !callDataError && (
{!!callInfo && !!pastedCallInfo && !callDataError && (
<CallInfo
aggregatedData={{
args: getDisplayArgs(pastedCallInfo.call),
callData: pastedCallData,
name: getExtrinsicName(pastedCallInfo.section, pastedCallInfo.method)
args: getDisplayArgs(callInfo.call),
callData: callDataToUse,
name: getExtrinsicName(callInfo.section, callInfo.method)
}}
expanded
withProxyFiltered={false}
Expand Down

0 comments on commit 499b33f

Please sign in to comment.