From df185cc9f5bd516b3eead7afca65304f06060166 Mon Sep 17 00:00:00 2001 From: "Brandon McGinty (chatgpt)" Date: Sun, 9 Aug 2026 23:13:20 -0400 Subject: [PATCH] Queue status updates from network callbacks --- ui.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui.go b/ui.go index 19ffb59..8d715bd 100644 --- a/ui.go +++ b/ui.go @@ -140,12 +140,19 @@ func (b *Barnard) OnNoiseSuppressionToggle(ui *uiterm.Ui, key uiterm.Key) { } func (b *Barnard) UpdateGeneralStatus(text string, notice bool) { - b.statusText = text - b.statusNotice = notice - b.renderGeneralStatus() + b.postUI(func() { + b.statusText = text + b.statusNotice = notice + b.renderGeneralStatusNow() + }) } func (b *Barnard) renderGeneralStatus() { + b.postUI(func() { b.renderGeneralStatusNow() }) +} + +// renderGeneralStatusNow must run on the UI-owning goroutine. +func (b *Barnard) renderGeneralStatusNow() { text := b.statusText notice := b.statusNotice if notice {