mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
[purego] assethandler updates
This commit is contained in:
parent
b1e79411e7
commit
ac5d0e54f0
3 changed files with 33 additions and 3 deletions
|
|
@ -84,3 +84,13 @@ func (r *request) Response() ResponseWriter {
|
|||
r.rw = &responseWriter{req: r.req}
|
||||
return r.rw
|
||||
}
|
||||
|
||||
func (r *request) Close() error {
|
||||
var err error
|
||||
if r.body != nil {
|
||||
err = r.body.Close()
|
||||
}
|
||||
r.Response().Finish()
|
||||
r.Release()
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,19 +121,18 @@ func (rw *responseWriter) WriteHeader(code int) {
|
|||
}
|
||||
}
|
||||
|
||||
func (rw *responseWriter) Finish() error {
|
||||
func (rw *responseWriter) Finish() {
|
||||
if !rw.wroteHeader {
|
||||
rw.WriteHeader(http.StatusNotImplemented)
|
||||
}
|
||||
|
||||
if rw.finished {
|
||||
return nil
|
||||
return
|
||||
}
|
||||
rw.finished = true
|
||||
if rw.w != nil {
|
||||
rw.w.Close()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rw *responseWriter) finishWithError(code int, err error) {
|
||||
|
|
|
|||
|
|
@ -390,6 +390,27 @@ func (a *App) Run() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// activate is called by the implementation to notify it is ready to run
|
||||
func (a *App) activate() {
|
||||
a.info("Starting window(s)")
|
||||
// run windows
|
||||
for _, window := range a.windows {
|
||||
go window.run()
|
||||
}
|
||||
|
||||
a.info("Starting systray(s)")
|
||||
// run system trays
|
||||
for _, systray := range a.systemTrays {
|
||||
go systray.Run()
|
||||
}
|
||||
|
||||
// set the application menu
|
||||
a.impl.setApplicationMenu(a.ApplicationMenu)
|
||||
|
||||
// set the application Icon
|
||||
a.impl.setIcon(a.options.Icon)
|
||||
}
|
||||
|
||||
func (a *App) handleApplicationEvent(event uint) {
|
||||
a.applicationEventListenersLock.RLock()
|
||||
listeners, ok := a.applicationEventListeners[event]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue