mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 06:51:26 +08:00
[windows-x] Startup/Shutdown -> OnStartup/OnShutdown
This commit is contained in:
parent
e00d65d468
commit
58dc917fb7
@ -25,7 +25,7 @@ func (b *App) startup(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// shutdown is called at application termination
|
// shutdown is called at application termination
|
||||||
func (b *App) shutdown() {
|
func (b *App) shutdown(ctx context.Context) {
|
||||||
// Perform your teardown here
|
// Perform your teardown here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
"github.com/wailsapp/wails/v2"
|
"github.com/wailsapp/wails/v2"
|
||||||
"github.com/wailsapp/wails/v2/pkg/logger"
|
"github.com/wailsapp/wails/v2/pkg/logger"
|
||||||
"github.com/wailsapp/wails/v2/pkg/menu"
|
|
||||||
"github.com/wailsapp/wails/v2/pkg/options"
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
||||||
)
|
)
|
||||||
@ -30,7 +29,6 @@ func main() {
|
|||||||
Frameless: false,
|
Frameless: false,
|
||||||
StartHidden: false,
|
StartHidden: false,
|
||||||
HideWindowOnClose: false,
|
HideWindowOnClose: false,
|
||||||
DevTools: false,
|
|
||||||
RGBA: 0x000000FF,
|
RGBA: 0x000000FF,
|
||||||
Windows: &windows.Options{
|
Windows: &windows.Options{
|
||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
@ -41,11 +39,10 @@ func main() {
|
|||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
WindowBackgroundIsTranslucent: true,
|
WindowBackgroundIsTranslucent: true,
|
||||||
TitleBar: mac.TitleBarHiddenInset(),
|
TitleBar: mac.TitleBarHiddenInset(),
|
||||||
Menu: menu.DefaultMacMenu(),
|
|
||||||
},
|
},
|
||||||
LogLevel: logger.DEBUG,
|
LogLevel: logger.DEBUG,
|
||||||
Startup: app.startup,
|
OnStartup: app.startup,
|
||||||
Shutdown: app.shutdown,
|
OnShutdown: app.shutdown,
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// App application struct
|
// App application struct
|
||||||
type App struct {
|
type App struct {
|
||||||
runtime *wails.Runtime
|
ctx context.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewApp creates a new App application struct
|
// NewApp creates a new App application struct
|
||||||
@ -17,13 +16,13 @@ func NewApp() *App {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// startup is called at application startup
|
// startup is called at application startup
|
||||||
func (b *App) startup(runtime *wails.Runtime) {
|
func (b *App) startup(ctx context.Context) {
|
||||||
// Perform your setup here
|
// Perform your setup here
|
||||||
b.runtime = runtime
|
b.ctx = ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
// shutdown is called at application termination
|
// shutdown is called at application termination
|
||||||
func (b *App) shutdown() {
|
func (b *App) shutdown(ctx context.Context) {
|
||||||
// Perform your teardown here
|
// Perform your teardown here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
"github.com/wailsapp/wails/v2"
|
"github.com/wailsapp/wails/v2"
|
||||||
"github.com/wailsapp/wails/v2/pkg/logger"
|
"github.com/wailsapp/wails/v2/pkg/logger"
|
||||||
"github.com/wailsapp/wails/v2/pkg/menu"
|
|
||||||
"github.com/wailsapp/wails/v2/pkg/options"
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
||||||
)
|
)
|
||||||
@ -30,7 +29,6 @@ func main() {
|
|||||||
Frameless: false,
|
Frameless: false,
|
||||||
StartHidden: false,
|
StartHidden: false,
|
||||||
HideWindowOnClose: false,
|
HideWindowOnClose: false,
|
||||||
DevTools: false,
|
|
||||||
RGBA: 0x000000FF,
|
RGBA: 0x000000FF,
|
||||||
Windows: &windows.Options{
|
Windows: &windows.Options{
|
||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
@ -41,11 +39,10 @@ func main() {
|
|||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
WindowBackgroundIsTranslucent: true,
|
WindowBackgroundIsTranslucent: true,
|
||||||
TitleBar: mac.TitleBarHiddenInset(),
|
TitleBar: mac.TitleBarHiddenInset(),
|
||||||
Menu: menu.DefaultMacMenu(),
|
|
||||||
},
|
},
|
||||||
LogLevel: logger.DEBUG,
|
LogLevel: logger.DEBUG,
|
||||||
Startup: app.startup,
|
OnStartup: app.startup,
|
||||||
Shutdown: app.shutdown,
|
OnShutdown: app.shutdown,
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
|
@ -22,7 +22,7 @@ func (b *App) startup(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// shutdown is called at application termination
|
// shutdown is called at application termination
|
||||||
func (b *App) shutdown() {
|
func (b *App) shutdown(ctx context.Context) {
|
||||||
// Perform your teardown here
|
// Perform your teardown here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
"github.com/wailsapp/wails/v2"
|
"github.com/wailsapp/wails/v2"
|
||||||
"github.com/wailsapp/wails/v2/pkg/logger"
|
"github.com/wailsapp/wails/v2/pkg/logger"
|
||||||
"github.com/wailsapp/wails/v2/pkg/menu"
|
|
||||||
"github.com/wailsapp/wails/v2/pkg/options"
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
"github.com/wailsapp/wails/v2/pkg/options/mac"
|
||||||
)
|
)
|
||||||
@ -30,7 +29,6 @@ func main() {
|
|||||||
Frameless: false,
|
Frameless: false,
|
||||||
StartHidden: false,
|
StartHidden: false,
|
||||||
HideWindowOnClose: false,
|
HideWindowOnClose: false,
|
||||||
DevTools: false,
|
|
||||||
RGBA: 0x000000FF,
|
RGBA: 0x000000FF,
|
||||||
Windows: &windows.Options{
|
Windows: &windows.Options{
|
||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
@ -41,11 +39,10 @@ func main() {
|
|||||||
WebviewIsTransparent: true,
|
WebviewIsTransparent: true,
|
||||||
WindowBackgroundIsTranslucent: true,
|
WindowBackgroundIsTranslucent: true,
|
||||||
TitleBar: mac.TitleBarHiddenInset(),
|
TitleBar: mac.TitleBarHiddenInset(),
|
||||||
Menu: menu.DefaultMacMenu(),
|
|
||||||
},
|
},
|
||||||
LogLevel: logger.DEBUG,
|
LogLevel: logger.DEBUG,
|
||||||
Startup: app.startup,
|
OnStartup: app.startup,
|
||||||
Shutdown: app.shutdown,
|
OnShutdown: app.shutdown,
|
||||||
Bind: []interface{}{
|
Bind: []interface{}{
|
||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build desktop && !server
|
||||||
// +build desktop,!server
|
// +build desktop,!server
|
||||||
|
|
||||||
package app
|
package app
|
||||||
@ -45,7 +46,7 @@ type App struct {
|
|||||||
// This is our binding DB
|
// This is our binding DB
|
||||||
bindings *binding.Bindings
|
bindings *binding.Bindings
|
||||||
|
|
||||||
// Startup/Shutdown
|
// OnStartup/OnShutdown
|
||||||
startupCallback func(ctx context.Context)
|
startupCallback func(ctx context.Context)
|
||||||
shutdownCallback func()
|
shutdownCallback func()
|
||||||
}
|
}
|
||||||
@ -82,7 +83,7 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
|||||||
window := ffenestri.NewApplicationWithConfig(appoptions, myLogger, menuManager)
|
window := ffenestri.NewApplicationWithConfig(appoptions, myLogger, menuManager)
|
||||||
|
|
||||||
// Create binding exemptions - Ugly hack. There must be a better way
|
// Create binding exemptions - Ugly hack. There must be a better way
|
||||||
bindingExemptions := []interface{}{appoptions.Startup, appoptions.Shutdown}
|
bindingExemptions := []interface{}{appoptions.OnStartup, appoptions.OnShutdown, appoptions.OnDomReady}
|
||||||
|
|
||||||
result := &App{
|
result := &App{
|
||||||
appType: "desktop",
|
appType: "desktop",
|
||||||
@ -91,8 +92,8 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
|||||||
logger: myLogger,
|
logger: myLogger,
|
||||||
bindings: binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions),
|
bindings: binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions),
|
||||||
menuManager: menuManager,
|
menuManager: menuManager,
|
||||||
startupCallback: appoptions.Startup,
|
startupCallback: appoptions.OnStartup,
|
||||||
shutdownCallback: appoptions.Shutdown,
|
shutdownCallback: appoptions.OnShutdown,
|
||||||
}
|
}
|
||||||
|
|
||||||
result.options = appoptions
|
result.options = appoptions
|
||||||
@ -246,7 +247,7 @@ func (a *App) Run() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown callback
|
// OnShutdown callback
|
||||||
if a.shutdownCallback != nil {
|
if a.shutdownCallback != nil {
|
||||||
a.shutdownCallback()
|
a.shutdownCallback()
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
//go:build dev
|
||||||
// +build dev
|
// +build dev
|
||||||
|
|
||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/wailsapp/wails/runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v2/internal/bridge"
|
"github.com/wailsapp/wails/v2/internal/bridge"
|
||||||
@ -49,7 +51,7 @@ type App struct {
|
|||||||
loglevelStore *runtime.Store
|
loglevelStore *runtime.Store
|
||||||
appconfigStore *runtime.Store
|
appconfigStore *runtime.Store
|
||||||
|
|
||||||
// Startup/Shutdown
|
// OnStartup/OnShutdown
|
||||||
startupCallback func(*runtime.Runtime)
|
startupCallback func(*runtime.Runtime)
|
||||||
shutdownCallback func()
|
shutdownCallback func()
|
||||||
|
|
||||||
@ -85,15 +87,15 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create binding exemptions - Ugly hack. There must be a better way
|
// Create binding exemptions - Ugly hack. There must be a better way
|
||||||
bindingExemptions := []interface{}{appoptions.Startup, appoptions.Shutdown}
|
bindingExemptions := []interface{}{appoptions.OnStartup, appoptions.OnShutdown, appoptions.OnDomReady}
|
||||||
|
|
||||||
result := &App{
|
result := &App{
|
||||||
appType: "dev",
|
appType: "dev",
|
||||||
bindings: binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions),
|
bindings: binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions),
|
||||||
logger: myLogger,
|
logger: myLogger,
|
||||||
servicebus: servicebus.New(myLogger),
|
servicebus: servicebus.New(myLogger),
|
||||||
startupCallback: appoptions.Startup,
|
startupCallback: appoptions.OnStartup,
|
||||||
shutdownCallback: appoptions.Shutdown,
|
shutdownCallback: appoptions.OnShutdown,
|
||||||
bridge: bridge.NewBridge(myLogger),
|
bridge: bridge.NewBridge(myLogger),
|
||||||
menuManager: menuManager,
|
menuManager: menuManager,
|
||||||
}
|
}
|
||||||
@ -235,7 +237,7 @@ func (a *App) Run() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown callback
|
// OnShutdown callback
|
||||||
if a.shutdownCallback != nil {
|
if a.shutdownCallback != nil {
|
||||||
a.shutdownCallback()
|
a.shutdownCallback()
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
//go:build server && !desktop
|
||||||
// +build server,!desktop
|
// +build server,!desktop
|
||||||
|
|
||||||
package app
|
package app
|
||||||
@ -37,7 +38,7 @@ type App struct {
|
|||||||
|
|
||||||
debug bool
|
debug bool
|
||||||
|
|
||||||
// Startup/Shutdown
|
// OnStartup/OnShutdown
|
||||||
startupCallback func(ctx context.Context)
|
startupCallback func(ctx context.Context)
|
||||||
shutdownCallback func()
|
shutdownCallback func()
|
||||||
}
|
}
|
||||||
@ -58,8 +59,8 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
|||||||
logger: myLogger,
|
logger: myLogger,
|
||||||
servicebus: servicebus.New(myLogger),
|
servicebus: servicebus.New(myLogger),
|
||||||
webserver: webserver.NewWebServer(myLogger),
|
webserver: webserver.NewWebServer(myLogger),
|
||||||
startupCallback: appoptions.Startup,
|
startupCallback: appoptions.OnStartup,
|
||||||
shutdownCallback: appoptions.Shutdown,
|
shutdownCallback: appoptions.OnShutdown,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialise app
|
// Initialise app
|
||||||
|
@ -31,16 +31,16 @@ type App struct {
|
|||||||
// Indicates if the app is in debug mode
|
// Indicates if the app is in debug mode
|
||||||
debug bool
|
debug bool
|
||||||
|
|
||||||
// Startup/Shutdown
|
// OnStartup/OnShutdown
|
||||||
startupCallback func(ctx context.Context)
|
startupCallback func(ctx context.Context)
|
||||||
shutdownCallback func()
|
shutdownCallback func(ctx context.Context)
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) Run() error {
|
func (a *App) Run() error {
|
||||||
err := a.frontend.Run(a.ctx)
|
err := a.frontend.Run(a.ctx)
|
||||||
if a.shutdownCallback != nil {
|
if a.shutdownCallback != nil {
|
||||||
a.shutdownCallback()
|
a.shutdownCallback(a.ctx)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -95,7 +95,7 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create binding exemptions - Ugly hack. There must be a better way
|
// Create binding exemptions - Ugly hack. There must be a better way
|
||||||
bindingExemptions := []interface{}{appoptions.Startup, appoptions.Shutdown}
|
bindingExemptions := []interface{}{appoptions.OnStartup, appoptions.OnShutdown, appoptions.OnDomReady}
|
||||||
appBindings := binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions)
|
appBindings := binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions)
|
||||||
eventHandler := runtime.NewEvents(myLogger)
|
eventHandler := runtime.NewEvents(myLogger)
|
||||||
ctx = context.WithValue(ctx, "events", eventHandler)
|
ctx = context.WithValue(ctx, "events", eventHandler)
|
||||||
@ -112,8 +112,8 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
|||||||
frontend: appFrontend,
|
frontend: appFrontend,
|
||||||
logger: myLogger,
|
logger: myLogger,
|
||||||
menuManager: menuManager,
|
menuManager: menuManager,
|
||||||
startupCallback: appoptions.Startup,
|
startupCallback: appoptions.OnStartup,
|
||||||
shutdownCallback: appoptions.Shutdown,
|
shutdownCallback: appoptions.OnShutdown,
|
||||||
debug: true,
|
debug: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"github.com/wailsapp/wails/v2/internal/binding"
|
"github.com/wailsapp/wails/v2/internal/binding"
|
||||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||||
|
"github.com/wailsapp/wails/v2/internal/frontend/desktop"
|
||||||
"github.com/wailsapp/wails/v2/internal/frontend/dispatcher"
|
"github.com/wailsapp/wails/v2/internal/frontend/dispatcher"
|
||||||
"github.com/wailsapp/wails/v2/internal/frontend/runtime"
|
"github.com/wailsapp/wails/v2/internal/frontend/runtime"
|
||||||
"github.com/wailsapp/wails/v2/internal/logger"
|
"github.com/wailsapp/wails/v2/internal/logger"
|
||||||
@ -27,16 +28,16 @@ type App struct {
|
|||||||
// Indicates if the app is in debug mode
|
// Indicates if the app is in debug mode
|
||||||
debug bool
|
debug bool
|
||||||
|
|
||||||
// Startup/Shutdown
|
// OnStartup/OnShutdown
|
||||||
startupCallback func(ctx context.Context)
|
startupCallback func(ctx context.Context)
|
||||||
shutdownCallback func()
|
shutdownCallback func(ctx context.Context)
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) Run() error {
|
func (a *App) Run() error {
|
||||||
err := a.frontend.Run(a.ctx)
|
err := a.frontend.Run(a.ctx)
|
||||||
if a.shutdownCallback != nil {
|
if a.shutdownCallback != nil {
|
||||||
a.shutdownCallback()
|
a.shutdownCallback(a.ctx)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -72,22 +73,22 @@ func CreateApp(appoptions *options.App) (*App, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create binding exemptions - Ugly hack. There must be a better way
|
// Create binding exemptions - Ugly hack. There must be a better way
|
||||||
bindingExemptions := []interface{}{appoptions.Startup, appoptions.Shutdown}
|
bindingExemptions := []interface{}{appoptions.OnStartup, appoptions.OnShutdown, appoptions.OnDomReady}
|
||||||
appBindings := binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions)
|
appBindings := binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions)
|
||||||
eventHandler := runtime.NewEvents(myLogger)
|
eventHandler := runtime.NewEvents(myLogger)
|
||||||
ctx = context.WithValue(ctx, "events", eventHandler)
|
ctx = context.WithValue(ctx, "events", eventHandler)
|
||||||
messageDispatcher := dispatcher.NewDispatcher(myLogger, appBindings, eventHandler)
|
messageDispatcher := dispatcher.NewDispatcher(myLogger, appBindings, eventHandler)
|
||||||
|
|
||||||
appFrontend := NewFrontend(appoptions, myLogger, appBindings, messageDispatcher, menuManager)
|
appFrontend := desktop.NewFrontend(ctx, appoptions, myLogger, appBindings, messageDispatcher)
|
||||||
eventHandler.SetFrontend(appFrontend)
|
eventHandler.AddFrontend(appFrontend)
|
||||||
|
|
||||||
result := &App{
|
result := &App{
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
frontend: appFrontend,
|
frontend: appFrontend,
|
||||||
logger: myLogger,
|
logger: myLogger,
|
||||||
menuManager: menuManager,
|
menuManager: menuManager,
|
||||||
startupCallback: appoptions.Startup,
|
startupCallback: appoptions.OnStartup,
|
||||||
shutdownCallback: appoptions.Shutdown,
|
shutdownCallback: appoptions.OnShutdown,
|
||||||
debug: false,
|
debug: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ func NewDesktopAssetServer(ctx context.Context, assets embed.FS, bindingsJSON st
|
|||||||
|
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
buffer.WriteString(`window.wailsbindings='` + bindingsJSON + `';` + "\n")
|
buffer.WriteString(`window.wailsbindings='` + bindingsJSON + `';` + "\n")
|
||||||
buffer.Write(runtime.RuntimeDesktopJS)
|
buffer.Write(runtime.RuntimeJS)
|
||||||
result.runtimeJS = buffer.Bytes()
|
result.runtimeJS = buffer.Bytes()
|
||||||
err := result.init(assets)
|
err := result.init(assets)
|
||||||
return result, err
|
return result, err
|
||||||
|
@ -84,7 +84,7 @@ func (e *Event) Start() error {
|
|||||||
|
|
||||||
// Spin off a go routine
|
// Spin off a go routine
|
||||||
go func() {
|
go func() {
|
||||||
defer e.logger.Trace("Shutdown")
|
defer e.logger.Trace("OnShutdown")
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-e.ctx.Done():
|
case <-e.ctx.Done():
|
||||||
|
@ -27,7 +27,7 @@ type Runtime struct {
|
|||||||
//ctx
|
//ctx
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
|
|
||||||
// Startup Hook
|
// OnStartup Hook
|
||||||
startupOnce sync.Once
|
startupOnce sync.Once
|
||||||
|
|
||||||
// Service bus
|
// Service bus
|
||||||
@ -66,7 +66,7 @@ func (r *Runtime) Start() error {
|
|||||||
|
|
||||||
// Spin off a go routine
|
// Spin off a go routine
|
||||||
go func() {
|
go func() {
|
||||||
defer r.logger.Trace("Shutdown")
|
defer r.logger.Trace("OnShutdown")
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case hooksMessage := <-r.hooksChannel:
|
case hooksMessage := <-r.hooksChannel:
|
||||||
|
@ -222,6 +222,10 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
|
|||||||
tags.Add(options.WebView2Strategy)
|
tags.Add(options.WebView2Strategy)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.Mode == Production {
|
||||||
|
tags.Add("production")
|
||||||
|
}
|
||||||
|
|
||||||
tags.Deduplicate()
|
tags.Deduplicate()
|
||||||
|
|
||||||
// Add the output type build tag
|
// Add the output type build tag
|
||||||
|
@ -32,8 +32,9 @@ type App struct {
|
|||||||
Menu *menu.Menu
|
Menu *menu.Menu
|
||||||
Logger logger.Logger `json:"-"`
|
Logger logger.Logger `json:"-"`
|
||||||
LogLevel logger.LogLevel
|
LogLevel logger.LogLevel
|
||||||
Startup func(ctx context.Context) `json:"-"`
|
OnStartup func(ctx context.Context) `json:"-"`
|
||||||
Shutdown func() `json:"-"`
|
OnDomReady func(ctx context.Context) `json:"-"`
|
||||||
|
OnShutdown func(ctx context.Context) `json:"-"`
|
||||||
Bind []interface{}
|
Bind []interface{}
|
||||||
|
|
||||||
//ContextMenus []*menu.ContextMenu
|
//ContextMenus []*menu.ContextMenu
|
||||||
|
Loading…
Reference in New Issue
Block a user