Skip to content

Commit 4a84725

Browse files
committed
fix: remove log statement
1 parent 5fe8124 commit 4a84725

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

internal/types/types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ type TaskPrefix string
7070
func (t Task) Prefix() (TaskPrefix, bool) {
7171
summEls := strings.Split(t.Summary, PrefixDelimiter)
7272
if len(summEls) > 1 {
73+
// This shouldn't happen, but it's still good to check this to ensure
74+
// the quick filter list doesn't misbehave
75+
if strings.TrimSpace(summEls[0]) == "" {
76+
return "", false
77+
}
7378
return TaskPrefix(strings.TrimSpace(summEls[0])), true
7479
}
7580
return "", false

internal/ui/update.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package ui
22

33
import (
44
"fmt"
5-
"log"
65
"os"
76
"sort"
87
"strings"
@@ -32,7 +31,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3231
if m.activeView == taskListView || m.activeView == archivedTaskListView {
3332
switch msg := msg.(type) {
3433
case tea.KeyMsg:
35-
log.Printf("msg: %#v\n", msg)
3634
if m.taskList.FilterState() == list.Filtering {
3735
m.taskList, cmd = m.taskList.Update(msg)
3836
cmds = append(cmds, cmd)
@@ -152,7 +150,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
152150
}
153151

154152
case tea.KeyMsg:
155-
log.Printf("msg: %#v\n", msg)
156153
switch keypress := msg.String(); keypress {
157154

158155
case "Q":
@@ -566,7 +563,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
566563
t, ok := li.(types.Task)
567564
if ok {
568565
prefix, pOk := t.Prefix()
569-
if pOk && prefix != "" {
566+
if pOk {
570567
taskPrefixes[prefix] = struct{}{}
571568
}
572569
}

0 commit comments

Comments
 (0)