summaryrefslogtreecommitdiff
path: root/internal/client/ui/core/chat
diff options
context:
space:
mode:
Diffstat (limited to 'internal/client/ui/core/chat')
-rw-r--r--internal/client/ui/core/chat/chat.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go
index b2f33a5..83edc8f 100644
--- a/internal/client/ui/core/chat/chat.go
+++ b/internal/client/ui/core/chat/chat.go
@@ -329,13 +329,28 @@ func (m *Model) sendMessage() tea.Cmd {
})
}
-func (m *Model) SetNetworkIndex(networkIndex int) {
- m.networkIndex = networkIndex
+// func (m *Model) SetNetworkIndex(networkIndex int) {
+// if m.networkIndex != networkIndex {
+// m.index = -1
+// }
+// m.networkIndex = networkIndex
+// }
+
+func (m *Model) SetReceiver(receiverIndex int) {
+ if m.receiverIndex == nil || *m.receiverIndex != receiverIndex {
+ m.index = -1
+ }
+ m.receiverIndex = &receiverIndex
+ m.frequencyIndex = nil
}
-func (m *Model) Set(receiverIndex, frequencyIndex *int) {
- m.receiverIndex = receiverIndex
- m.frequencyIndex = frequencyIndex
+func (m *Model) SetFrequency(networkIndex, frequencyIndex int) {
+ if m.frequencyIndex == nil || *m.frequencyIndex != frequencyIndex {
+ m.index = -1
+ }
+ m.receiverIndex = nil
+ m.frequencyIndex = &frequencyIndex
+ m.networkIndex = networkIndex
}
func (m *Model) renderMessage(message data.Message, builder *strings.Builder, header bool) int {