Skip to content

Commit

Permalink
[fix] lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yumafuu committed Jul 26, 2024
1 parent 59f3f6b commit f8ef531
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions tui/vbox/vbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,17 @@ func (v *ValueBox) SetText(s string, b bool) {
func (v *ValueBox) WaitTopic() {
chUpdate := v.pubsub.Sub(pubsub.TopicWriteValueBox)

for {
select {
case msg := <-chUpdate:
v.SetMode(ModeUpdate)

if p, ok := msg.(types.Parameter); ok {
s := *p.Value

v.TextArea.SetText(s, true)
v.SetPrev(p)
}
if b, ok := msg.(string); ok {
v.TextArea.SetText(b, true)
}
for msg := range chUpdate {
v.SetMode(ModeUpdate)

if p, ok := msg.(types.Parameter); ok {
s := *p.Value

v.TextArea.SetText(s, true)
v.SetPrev(p)
}
if b, ok := msg.(string); ok {
v.TextArea.SetText(b, true)
}
}
}

0 comments on commit f8ef531

Please sign in to comment.