diff --git a/desktop/app.go b/desktop/app.go index 6369d09..4bf36f1 100644 --- a/desktop/app.go +++ b/desktop/app.go @@ -124,6 +124,23 @@ func (a *App) startup(ctx context.Context) { }) a.startPipeline(ctx) + + // Recognition starts with the app. Until this, the engine only ever + // started when somebody pressed Start - which meant a till that rebooted + // overnight came back with the window open, the tray icon showing, the + // session restored, and recognition off until a shop assistant noticed. + // That is the failure the tray colours exist to catch, and it should not + // be the default state every morning. + // + // Guarded on the interpreter actually being there: on a PC where setup has + // not run yet, starting the supervisor would loop on a missing executable + // with nothing useful to say. The Start button still exists for the one + // case where somebody has deliberately stopped it. + if _, err := os.Stat(exe); err == nil { + a.sup.Start() + } else { + log.Printf("engine not installed yet (%s); run behavision-setup, then Start", exe) + } } // webhookURL is the loopback address the bridge is listening on, or empty