5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 20:03:01 +08:00

Fix: wails dev

This commit is contained in:
Lea Anthony 2022-04-21 07:40:56 +10:00
parent f6257d3d31
commit 7f3f56663f
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
4 changed files with 21 additions and 23 deletions

View File

@ -167,6 +167,11 @@ func (d *DevWebServer) WindowReload() {
d.desktopFrontend.WindowReload() d.desktopFrontend.WindowReload()
} }
func (d *DevWebServer) WindowReloadApp() {
d.broadcast("reloadapp")
d.desktopFrontend.WindowReloadApp()
}
func (d *DevWebServer) WindowSetTitle(title string) { func (d *DevWebServer) WindowSetTitle(title string) {
d.desktopFrontend.WindowSetTitle(title) d.desktopFrontend.WindowSetTitle(title)
} }
@ -260,6 +265,10 @@ func (d *DevWebServer) handleReload(c echo.Context) error {
d.WindowReload() d.WindowReload()
return c.NoContent(http.StatusNoContent) return c.NoContent(http.StatusNoContent)
} }
func (d *DevWebServer) handleReloadApp(c echo.Context) error {
d.WindowReloadApp()
return c.NoContent(http.StatusNoContent)
}
func (d *DevWebServer) handleIPCWebSocket(c echo.Context) error { func (d *DevWebServer) handleIPCWebSocket(c echo.Context) error {
websocket.Handler(func(c *websocket.Conn) { websocket.Handler(func(c *websocket.Conn) {

View File

@ -104,6 +104,10 @@ function handleMessage(message) {
window.runtime.WindowReload(); window.runtime.WindowReload();
return; return;
} }
if (message.data === "reloadapp") {
window.runtime.WindowReloadApp()
return;
}
// As a bridge we ignore js and css injections // As a bridge we ignore js and css injections
switch (message.data[0]) { switch (message.data[0]) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long