diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-12-23 20:32:27 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-12-23 20:32:27 +0200 |
| commit | 2618785d1069298f0c19f6fe1e31692b0ae575ad (patch) | |
| tree | 85881fb51b5e78e83ae07b108fccff1e60650bd6 /internal/client/ui/core | |
| parent | f49f48d17bd50fe36ef08fdd4dff20e4cbb7e4f9 (diff) | |
Changed error when a frequency is empty to a gray message saying it's
empty and suggesting to send a message
Diffstat (limited to 'internal/client/ui/core')
| -rw-r--r-- | internal/client/ui/core/chat/chat.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go index 396622b..e435fd4 100644 --- a/internal/client/ui/core/chat/chat.go +++ b/internal/client/ui/core/chat/chat.go @@ -43,9 +43,10 @@ var ( LeftCorner = Border.BottomLeft + Border.Bottom RightCorner = Border.Bottom + Border.BottomRight - NilBtreeError = lipgloss.NewStyle(). - Foreground(colors.Red).Padding(0, PaddingCount). - SetString("Error loading messages!") + NoMessages = lipgloss.NewStyle(). + Foreground(colors.LightGray).Padding(0, PaddingCount, 1). + AlignHorizontal(lipgloss.Center).AlignVertical(lipgloss.Bottom). + SetString("This frequency has no messages, start transmiting!") ) const ( @@ -162,7 +163,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { case "k": if m.index == -1 && m.offset != SnapToBottom { m.index = m.offset - m.messagesHeight - } else if m.index == -1{ + } else if m.index == -1 { m.index = 1 // Skip bottom blank line } else { m.index++ @@ -374,7 +375,7 @@ func (m *Model) renderMessages(screenHeight int) string { } if btree == nil { - return NilBtreeError.Height(screenHeight).String() + return NoMessages.Width(m.width).Height(screenHeight-1).String() + "\n" } height := screenHeight |
