wails/v3/pkg/application/messageprocessor_application.go
Andrey Pshenkin 561473d992
[V3] Refactor binding transport layer (#4702)
* custom transport initial

* transport codecs

* runtime set transport

* events transport

* clauded example

* bundled runtime

* wip: transport

* rework transports

* rework dialog responses

* cleanup

* cleanup

* improve error handling in HTTPTransport

* cleanup

* cleanup

* cleanup

* cleanup

* review changes

* review changes

* review changes

* review changes

* review changes

* review changes

* review changes

* move documentation to website docs

* update doc

* update changelog

* introduce JSClient method for transport for embedding JS part in transport

---------

Co-authored-by: Atterpac <Capretta.Michael@gmail.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2025-12-07 22:19:12 +11:00

35 lines
693 B
Go

package application
import (
"github.com/wailsapp/wails/v3/pkg/errs"
)
const (
ApplicationHide = 0
ApplicationShow = 1
ApplicationQuit = 2
)
var applicationMethodNames = map[int]string{
ApplicationQuit: "Quit",
ApplicationHide: "Hide",
ApplicationShow: "Show",
}
func (m *MessageProcessor) processApplicationMethod(
req *RuntimeRequest,
) (any, error) {
switch req.Method {
case ApplicationQuit:
globalApplication.Quit()
return unit, nil
case ApplicationHide:
globalApplication.Hide()
return unit, nil
case ApplicationShow:
globalApplication.Show()
return unit, nil
default:
return nil, errs.NewInvalidApplicationCallErrorf("unknown method %d", req.Method)
}
}