mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v3] Fix bindings
This commit is contained in:
@@ -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])
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user