diff --git a/internal/tui/bubbles/git/log/bubble.go b/internal/tui/bubbles/git/log/bubble.go index 773784e7ab4fe9bc6f0e979b96ef0a9314431326..600011791a4424921cd0a12d8f4daf6ef0e3bf0c 100644 --- a/internal/tui/bubbles/git/log/bubble.go +++ b/internal/tui/bubbles/git/log/bubble.go @@ -158,7 +158,7 @@ func (b *Bubble) GotoTop() { } func (b *Bubble) Init() tea.Cmd { - return b.reset() + return nil } func (b *Bubble) SetSize(width, height int) { diff --git a/internal/tui/bubbles/git/refs/bubble.go b/internal/tui/bubbles/git/refs/bubble.go index c180d128771d1cab56ecc810f102dd3ba09953f5..53fec666a1aea7797338fdfabd5a7dbf407371f1 100644 --- a/internal/tui/bubbles/git/refs/bubble.go +++ b/internal/tui/bubbles/git/refs/bubble.go @@ -106,10 +106,14 @@ func (b *Bubble) SetBranch(ref *plumbing.Reference) (tea.Model, tea.Cmd) { } } -func (b *Bubble) Init() tea.Cmd { +func (b *Bubble) reset() tea.Cmd { return b.updateItems() } +func (b *Bubble) Init() tea.Cmd { + return nil +} + func (b *Bubble) SetSize(width, height int) { b.width = width b.height = height @@ -152,7 +156,7 @@ func (b *Bubble) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case tea.KeyMsg: switch msg.String() { case "B": - cmds = append(cmds, b.updateItems()) + return b, b.reset() case "enter", "right", "l": if b.list.Index() >= 0 { ref := b.list.SelectedItem().(item).Reference diff --git a/internal/tui/bubbles/git/tree/bubble.go b/internal/tui/bubbles/git/tree/bubble.go index f16a9d71b14b4bcc356fcd44d2e859a3e90aeff5..805aa5865088bc0ddfd734dd241312f67db9ac6f 100644 --- a/internal/tui/bubbles/git/tree/bubble.go +++ b/internal/tui/bubbles/git/tree/bubble.go @@ -168,7 +168,7 @@ func (b *Bubble) reset() tea.Cmd { } func (b *Bubble) Init() tea.Cmd { - return b.reset() + return nil } func (b *Bubble) SetSize(width, height int) {