From 154186016f6de3503c917108229829c29664509a Mon Sep 17 00:00:00 2001 From: Lucas Menendez Date: Sun, 7 Apr 2024 06:44:17 +0200 Subject: [PATCH] small struct fix --- cmd/webassembly/main.go | 7 ++++++- web/app.js | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/webassembly/main.go b/cmd/webassembly/main.go index fe2d78a..fdc70b5 100644 --- a/cmd/webassembly/main.go +++ b/cmd/webassembly/main.go @@ -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) diff --git a/web/app.js b/web/app.js index 2c9f84e..ff54f15 100644 --- a/web/app.js +++ b/web/app.js @@ -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;