diff options
Diffstat (limited to 'internal/tui/history_box.go')
-rw-r--r-- | internal/tui/history_box.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/tui/history_box.go b/internal/tui/history_box.go index 99fa4ac..00b39f3 100644 --- a/internal/tui/history_box.go +++ b/internal/tui/history_box.go @@ -159,7 +159,8 @@ func (m HistoryBoxModel) View(width, height int, isSelected bool, timer TimerBox var content string if len(m.entries) == 0 { - content = "📝 Recent History\n\nNo recent entries\n\nStart tracking time to\nsee your history here." + content = "📝 Recent History\n\n" + content += inactiveTimerStyle.Render("No recent entries\n\nStart tracking time to\nsee your history here.") } else { switch m.viewLevel { case HistoryLevelSummary: @@ -283,6 +284,9 @@ func (m HistoryBoxModel) renderSummaryView(timer TimerBoxModel) string { } func (m HistoryBoxModel) selectedEntries() []queries.TimeEntry { + if len(m.summaryItems) == 0 { + return nil + } summary := m.summaryItems[m.summarySelection] key := HistorySummaryKey{ Date: summary.Date.Local(), @@ -417,6 +421,10 @@ func (m HistoryBoxModel) selectedEntry() queries.TimeEntry { } func (m HistoryBoxModel) selection() (string, string, string, *float64) { + if len(m.summaryItems) == 0 { + return "", "", "", nil + } + item := m.summaryItems[m.summarySelection] clientID := strconv.FormatInt(item.ClientID, 10) |