From 0ffeb67a3c447dc2af16844a08585568c3008b11 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 6 Feb 2025 16:56:05 +0200 Subject: User signals now support not selecting any signal (which is the default on start to avoid "insta-reading" messages of the top isgnal) --- internal/client/ui/core/chat/chat.go | 2 +- internal/client/ui/core/signallist/signallist.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go index 37fc1a8..5764d45 100644 --- a/internal/client/ui/core/chat/chat.go +++ b/internal/client/ui/core/chat/chat.go @@ -710,7 +710,7 @@ func (m *Model) sendMessage() tea.Cmd { } func (m *Model) SetReceiver(receiverIndex int) tea.Cmd { - if m.receiverIndex == receiverIndex { + if m.receiverIndex == receiverIndex && m.frequencyIndex == -1 { return nil } m.ResetBeforeSwitch() diff --git a/internal/client/ui/core/signallist/signallist.go b/internal/client/ui/core/signallist/signallist.go index 3036017..3ae664e 100644 --- a/internal/client/ui/core/signallist/signallist.go +++ b/internal/client/ui/core/signallist/signallist.go @@ -234,7 +234,7 @@ func (m *Model) Index() int { } func (m *Model) SetIndex(index int) { - m.index = min(max(index, 0), len(m.Signals())-1) + m.index = min(max(index, -1), len(m.Signals())-1) if m.index < m.base { m.base = max(m.index, 0) } else if m.index >= m.base+m.height { -- cgit v1.3.1