Events to the frontend go through App.emit, and a test keeps their names in step with wails.ts. QEMU argument splitting, hidden console processes, the macOS release record, the running check and a few smaller helpers now exist once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
465 B
Go
15 lines
465 B
Go
package app
|
|
|
|
import wailsRuntime "github.com/wailsapp/wails/v2/pkg/runtime"
|
|
|
|
// emit sends an event to the frontend, which subscribes in frontend/src/wails.ts.
|
|
// Without a window it does nothing.
|
|
func (a *App) emit(name string, data ...any) {
|
|
if a.ctx != nil {
|
|
wailsRuntime.EventsEmit(a.ctx, name, data...)
|
|
}
|
|
}
|
|
|
|
// emitStateChanged asks the frontend to read the application state again.
|
|
func (a *App) emitStateChanged() { a.emit("reims:state-changed", true) }
|