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

fix for ipc binding

made reconnect modal a bit better
This commit is contained in:
Lea Anthony 2019-01-12 15:56:49 +11:00
parent 3f2f1b45f6
commit 0ae5381203
2 changed files with 6 additions and 9 deletions

View File

@ -20,7 +20,7 @@
text-align: center;
width: 20em;
position: relative;
height: 17em;
height: 14em;
border-radius: 1em;
margin: 5% auto 0;
background-color: white;

View File

@ -39,6 +39,7 @@ func (h *Headless) Initialise(appConfig *AppConfig, ipcManager *ipcManager, even
h.ipcManager = ipcManager
h.appConfig = appConfig
h.eventManager = eventManager
ipcManager.bindRenderer(h)
h.log = newCustomLogger("Headless")
return nil
}
@ -99,17 +100,13 @@ func (h *Headless) start(conn *websocket.Conn) {
// set external.invoke
h.log.Infof("Connected to frontend.")
// If we are given an HTML fragment, load jquery
// for the html() function
if h.appConfig.isHTMLFragment {
// Inject jquery
jquery := BoxString(&defaultAssets, "jquery.3.3.1.min.js")
h.evalJS(jquery)
}
wailsRuntime := BoxString(&defaultAssets, "wails.js")
h.evalJS(wailsRuntime)
// Inject jquery
jquery := BoxString(&defaultAssets, "jquery.3.3.1.min.js")
h.evalJS(jquery)
// Inject the initial JS
for _, js := range h.initialisationJS {
h.sendMessage(conn, js)