Skip to content

Commit 29b2a2d

Browse files
committed
fix value is null
1 parent 29908c9 commit 29b2a2d

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

packages/ui/src/components/CallInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ const handleBalanceDisplay = ({
8888

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

9595
return (

packages/ui/src/components/EasySetup/FromCallData.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ const FromCallData = ({ className, onSetExtrinsic, isProxySelected, onSetErrorMe
3030
setIsProxyProxyRemoved(false)
3131
if (!api) return call
3232

33-
if (!isProxySelected) return call
34-
3533
const proxyProxyString = u8aToHex(api?.tx.proxy?.proxy.callIndex).toString()
3634

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

5250
// users may erroneously paste callData from the multisig calldata
@@ -106,12 +104,12 @@ const FromCallData = ({ className, onSetExtrinsic, isProxySelected, onSetErrorMe
106104
error={!!callDataError}
107105
fullWidth
108106
/>
109-
{!!pastedCallData && !!pastedCallInfo && !callDataError && (
107+
{!!callInfo && !!pastedCallInfo && !callDataError && (
110108
<CallInfo
111109
aggregatedData={{
112-
args: getDisplayArgs(pastedCallInfo.call),
113-
callData: pastedCallData,
114-
name: getExtrinsicName(pastedCallInfo.section, pastedCallInfo.method)
110+
args: getDisplayArgs(callInfo.call),
111+
callData: callDataToUse,
112+
name: getExtrinsicName(callInfo.section, callInfo.method)
115113
}}
116114
expanded
117115
withProxyFiltered={false}

0 commit comments

Comments
 (0)