diff --git a/src/layouts/account/detail.tsx b/src/layouts/account/detail.tsx index 339c964..f1350f3 100644 --- a/src/layouts/account/detail.tsx +++ b/src/layouts/account/detail.tsx @@ -178,9 +178,14 @@ class TabContractCallContent extends React.Component { var outputs = document.querySelectorAll( '.' + d.name + '-output' ) - for (var i: number = 0; i < outputs.length; i++) { - var output = outputs[i] as HTMLInputElement - output.value = result[i] + if (Array.isArray(result)) { + for (var i: number = 0; i < outputs.length; i++) { + var output = outputs[i] as HTMLInputElement + output.value = result[i] + } + } else { + var output = outputs[0] as HTMLInputElement + output.value = result } }) .catch((e: any) => { @@ -193,9 +198,14 @@ class TabContractCallContent extends React.Component { var outputs = document.querySelectorAll( '.' + d.name + '-output' ) - for (var i: number = 0; i < outputs.length; i++) { - var output = outputs[i] as HTMLInputElement - output.value = result[i] + if (Array.isArray(result)) { + for (var i: number = 0; i < outputs.length; i++) { + var output = outputs[i] as HTMLInputElement + output.value = result[i] + } + } else { + var output = outputs[0] as HTMLInputElement + output.value = result } }) .catch((e: any) => {