Skip to content

Commit

Permalink
small struct fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Apr 7, 2024
1 parent 1231c0e commit 1541860
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion cmd/webassembly/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ func main() {
}
// recover the message
minShares, maxShares, minMin, maxMin := gosss.ConfigLimits([]byte(p[0].String()))
return wasmResult([]int{minShares, maxShares, minMin, maxMin}, nil)
return wasmResult(map[string]int{
"minShares": minShares,
"maxShares": maxShares,
"minMin": minMin,
"maxMin": maxMin,
}, nil)
}))

js.Global().Set(jsClassName, gosssClass)
Expand Down
8 changes: 4 additions & 4 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ const app = createApp({
const result = JSON.parse(rawResult);
if (!result.error) {
this.config = {
minShares: result.data[0],
maxShares: result.data[1],
minMin: result.data[2],
maxMin: result.data[3],
minShares: result.data.minShares,
maxShares: result.data.maxShares,
minMin: result.data.minMin,
maxMin: result.data.maxMin,
}
if (this.sharesCount < this.config.minShares) this.sharesCount = this.config.minShares;
if (this.sharesCount > this.config.maxShares) this.sharesCount = this.config.maxShares;
Expand Down

0 comments on commit 1541860

Please sign in to comment.