Queue status updates from network callbacks
This commit is contained in:
committed by
Brandon McGinty
parent
bad4e8172a
commit
df185cc9f5
@@ -140,12 +140,19 @@ func (b *Barnard) OnNoiseSuppressionToggle(ui *uiterm.Ui, key uiterm.Key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Barnard) UpdateGeneralStatus(text string, notice bool) {
|
func (b *Barnard) UpdateGeneralStatus(text string, notice bool) {
|
||||||
b.statusText = text
|
b.postUI(func() {
|
||||||
b.statusNotice = notice
|
b.statusText = text
|
||||||
b.renderGeneralStatus()
|
b.statusNotice = notice
|
||||||
|
b.renderGeneralStatusNow()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Barnard) renderGeneralStatus() {
|
func (b *Barnard) renderGeneralStatus() {
|
||||||
|
b.postUI(func() { b.renderGeneralStatusNow() })
|
||||||
|
}
|
||||||
|
|
||||||
|
// renderGeneralStatusNow must run on the UI-owning goroutine.
|
||||||
|
func (b *Barnard) renderGeneralStatusNow() {
|
||||||
text := b.statusText
|
text := b.statusText
|
||||||
notice := b.statusNotice
|
notice := b.statusNotice
|
||||||
if notice {
|
if notice {
|
||||||
|
|||||||
Reference in New Issue
Block a user