Fix: Do not generate bindings for OnBeforeClose

This commit is contained in:
Lea Anthony
2022-08-20 08:59:43 +10:00
parent e353b49784
commit 2651d5d01a
3 changed files with 18 additions and 3 deletions
+6 -1
View File
@@ -25,7 +25,12 @@ type App struct {
func (a *App) Run() error {
// Create binding exemptions - Ugly hack. There must be a better way
bindingExemptions := []interface{}{a.appoptions.OnStartup, a.appoptions.OnShutdown, a.appoptions.OnDomReady}
bindingExemptions := []interface{}{
a.appoptions.OnStartup,
a.appoptions.OnShutdown,
a.appoptions.OnDomReady,
a.appoptions.OnBeforeClose,
}
appBindings := binding.NewBindings(a.logger, a.appoptions.Bind, bindingExemptions)
err := generateBindings(appBindings)
+6 -1
View File
@@ -185,7 +185,12 @@ func CreateApp(appoptions *options.App) (*App, error) {
}
// Create binding exemptions - Ugly hack. There must be a better way
bindingExemptions := []interface{}{appoptions.OnStartup, appoptions.OnShutdown, appoptions.OnDomReady}
bindingExemptions := []interface{}{
a.appoptions.OnStartup,
a.appoptions.OnShutdown,
a.appoptions.OnDomReady,
a.appoptions.OnBeforeClose,
}
appBindings := binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions)
err = generateBindings(appBindings)
+6 -1
View File
@@ -84,7 +84,12 @@ func CreateApp(appoptions *options.App) (*App, error) {
}
// Create binding exemptions - Ugly hack. There must be a better way
bindingExemptions := []interface{}{appoptions.OnStartup, appoptions.OnShutdown, appoptions.OnDomReady}
bindingExemptions := []interface{}{
a.appoptions.OnStartup,
a.appoptions.OnShutdown,
a.appoptions.OnDomReady,
a.appoptions.OnBeforeClose,
}
appBindings := binding.NewBindings(myLogger, appoptions.Bind, bindingExemptions)
eventHandler := runtime.NewEvents(myLogger)
ctx = context.WithValue(ctx, "events", eventHandler)