Skip to content

Commit 62b1882

Browse files
committed
fix wasm zip
1 parent c734c88 commit 62b1882

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

generator/app_wasm.go

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,37 @@
33
package generator
44

55
import (
6-
"bytes"
76
"log"
8-
"syscall/js"
97

108
wasmhttp "github.com/nlepage/go-wasm-http-server/v2"
119
)
1210

1311
var globalApp *App
1412

15-
func wasmZip(this js.Value, cb []js.Value) interface{} { //
13+
// func wasmZip(this js.Value, cb []js.Value) interface{} { //
1614

17-
if globalApp == nil {
18-
panic("global app not configured. Run app.Run(os.Args)")
19-
}
15+
// if globalApp == nil {
16+
// panic("global app not configured. Run app.Run(os.Args)")
17+
// }
2018

21-
b := bytes.Buffer{}
22-
err := globalApp.WriteZip(&b)
23-
if err != nil {
24-
log.Printf("error zipping: %s", err.Error())
25-
}
19+
// b := bytes.Buffer{}
20+
// err := globalApp.WriteZip(&b)
21+
// if err != nil {
22+
// log.Printf("error zipping: %s", err.Error())
23+
// }
2624

27-
log.Printf("completed")
25+
// log.Printf("completed")
2826

29-
data := b.Bytes()
27+
// data := b.Bytes()
3028

31-
dst := js.Global().Get("Uint8Array").New(len(data))
32-
js.CopyBytesToJS(dst, data)
33-
cb[0].Invoke(dst)
34-
return dst
35-
}
29+
// dst := js.Global().Get("Uint8Array").New(len(data))
30+
// js.CopyBytesToJS(dst, data)
31+
// cb[0].Invoke(dst)
32+
// return dst
33+
// }
3634

3735
func os_setup(a *App) {
38-
js.Global().Set("zipGeometry", js.FuncOf(wasmZip))
36+
// js.Global().Set("zipGeometry", js.FuncOf(wasmZip))
3937
globalApp = a
4038
}
4139

0 commit comments

Comments
 (0)