[v3] Fix bindings

This commit is contained in:
Lea Anthony
2023-08-27 15:54:01 +10:00
parent 2f9f63771b
commit cdf48e0589
25 changed files with 1106 additions and 357 deletions
+11 -3
View File
@@ -4,15 +4,23 @@ import (
"net/http"
)
func (m *MessageProcessor) processSystemMethod(method string, rw http.ResponseWriter, r *http.Request, window *WebviewWindow, params QueryParams) {
const (
SystemIsDarkMode = 0
)
var systemMethodNames = map[int]string{
SystemIsDarkMode: "IsDarkMode",
}
func (m *MessageProcessor) processSystemMethod(method int, rw http.ResponseWriter, r *http.Request, window *WebviewWindow, params QueryParams) {
switch method {
case "IsDarkMode":
case SystemIsDarkMode:
m.json(rw, globalApplication.IsDarkMode())
default:
m.httpError(rw, "Unknown system method: %s", method)
}
m.Info("Runtime:", "method", "System."+method)
m.Info("Runtime:", "method", "System."+systemMethodNames[method])
}