From 9a4f20f82453032b632ad6f929c23f0188f2f170 Mon Sep 17 00:00:00 2001 From: Alexei Anoshenko <2277098+anoshenko@users.noreply.github.com> Date: Sat, 11 Jul 2026 19:21:20 +0300 Subject: [PATCH] Fixing --- clientStorage.go | 4 ++-- session.go | 1 + wasmBridge.go | 4 ++++ webBridge.go | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/clientStorage.go b/clientStorage.go index 040c8e8..a875b22 100644 --- a/clientStorage.go +++ b/clientStorage.go @@ -91,9 +91,9 @@ func (storage *clientStorageData) Request(result func(key, value string), key .. } if buffer.Len() == 0 { - storage.bridge.callFunc("localStorageGetAll", request) + storage.bridge.localStorageRequest("localStorageGetAll", request) } else { - storage.bridge.callFunc("localStorageGet", request, buffer.String()) + storage.bridge.localStorageRequest("localStorageGet", request, buffer.String()) } } diff --git a/session.go b/session.go index 85708b1..5e52950 100644 --- a/session.go +++ b/session.go @@ -14,6 +14,7 @@ type bridge interface { startUpdateScript(htmlID string) bool finishUpdateScript(htmlID string) callFunc(funcName string, args ...any) bool + localStorageRequest(funcName string, args ...any) updateInnerHTML(htmlID, html string) appendToInnerHTML(htmlID, html string) updateCSSProperty(htmlID, property, value string) diff --git a/wasmBridge.go b/wasmBridge.go index 347e685..b6e3fd2 100644 --- a/wasmBridge.go +++ b/wasmBridge.go @@ -53,6 +53,10 @@ func (bridge *wasmBridge) callFunc(funcName string, args ...any) bool { return true } +func (bridge *wasmBridge) localStorageRequest(funcName string, args ...any) { + bridge.callFunc(funcName, args...) +} + func (bridge *wasmBridge) updateInnerHTML(htmlID, html string) { if ProtocolInDebugLog { DebugLog(fmt.Sprintf("%s.innerHTML = '%s'", htmlID, html)) diff --git a/webBridge.go b/webBridge.go index 9dc1a06..c1fdfc5 100644 --- a/webBridge.go +++ b/webBridge.go @@ -35,7 +35,6 @@ type httpBridge struct { responseBuffer strings.Builder response chan string remoteAddress string - //conn *websocket.Conn } type canvasVar struct { @@ -237,6 +236,10 @@ func (bridge *webBridge) callFunc(funcName string, args ...any) bool { return false } +func (bridge *webBridge) localStorageRequest(funcName string, args ...any) { + bridge.callFuncImmediately(funcName, args...) +} + func (bridge *webBridge) updateInnerHTML(htmlID, html string) { bridge.callFunc("updateInnerHTML", htmlID, html) }