diff --git a/cmd/db.go b/cmd/db.go index 2f865b8..e31ae7b 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -9,6 +9,8 @@ const ( func setupDB(dbpath string) (*sql.DB, error) { db, err := sql.Open("sqlite", dbpath) + db.SetMaxOpenConns(1) + db.SetMaxIdleConns(1) if err != nil { return nil, err } diff --git a/ui/update.go b/ui/update.go index 79ae5a9..fa3221f 100644 --- a/ui/update.go +++ b/ui/update.go @@ -165,6 +165,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { cmds = append(cmds, fetchJIRAIssues(m.jiraClient, m.jql)) case WorklogView: cmds = append(cmds, fetchLogEntries(m.db)) + m.worklogList.ResetSelected() } case "ctrl+s": if m.activeView == IssueListView { @@ -230,7 +231,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } } } - return m, tea.Sequence(cmds...) } case "?": m.lastView = m.activeView