summaryrefslogtreecommitdiff
path: root/internal/client/ui/core/core.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/client/ui/core/core.go')
-rw-r--r--internal/client/ui/core/core.go27
1 files changed, 15 insertions, 12 deletions
diff --git a/internal/client/ui/core/core.go b/internal/client/ui/core/core.go
index f986351..b1ed7e3 100644
--- a/internal/client/ui/core/core.go
+++ b/internal/client/ui/core/core.go
@@ -308,19 +308,22 @@ func (m *Model) updateConnected(msg tea.Msg) tea.Cmd {
return nil
}
+ var cmds []tea.Cmd
var cmd tea.Cmd
- switch m.focus {
- case FocusNetworkList:
- m.networkList, cmd = m.networkList.Update(msg)
- m.frequencyList.SetNetworkIndex(m.networkList.Index())
- m.chat.SetFrequency(m.networkList.Index(), m.frequencyList.Index())
- case FocusFrequencyList:
- m.frequencyList, cmd = m.frequencyList.Update(msg)
- m.chat.SetFrequency(m.networkList.Index(), m.frequencyList.Index())
- case FocusChat:
- m.chat, cmd = m.chat.Update(msg)
- }
- return cmd
+
+ m.networkList, cmd = m.networkList.Update(msg)
+ cmds = append(cmds, cmd)
+
+ m.frequencyList.SetNetworkIndex(m.networkList.Index())
+ m.frequencyList, cmd = m.frequencyList.Update(msg)
+ cmds = append(cmds, cmd)
+
+ cmd = m.chat.SetFrequency(m.networkList.Index(), m.frequencyList.Index())
+ cmds = append(cmds, cmd)
+ m.chat, cmd = m.chat.Update(msg)
+ cmds = append(cmds, cmd)
+
+ return tea.Batch(cmds...)
}
func (m *Model) updateLoadScreenContent() {