Skip to content

Commit

Permalink
fix: contract method return null array value
Browse files Browse the repository at this point in the history
  • Loading branch information
wu committed Aug 9, 2019
1 parent b18ca4e commit ce3448d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/layouts/account/detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,14 @@ class TabContractCallContent extends React.Component<any, any> {
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) => {
Expand All @@ -193,9 +198,14 @@ class TabContractCallContent extends React.Component<any, any> {
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) => {
Expand Down

0 comments on commit ce3448d

Please sign in to comment.