refactor: remove some of the clear screen commands

This commit is contained in:
Slug-Boi
2024-11-16 23:20:25 +01:00
parent 597d4f5572
commit a3336ed6c0
3 changed files with 9 additions and 13 deletions
+4 -6
View File
@@ -2,17 +2,17 @@ package tui
import (
"fmt"
"github.com/Slug-Boi/cocommit/src/cmd/utils"
"io"
"os"
"sort"
"strings"
"github.com/Slug-Boi/cocommit/src/cmd/utils"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/inancgumus/screen"
)
const listHeight = 14
@@ -201,14 +201,12 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.ClearScreen
case key.Matches(msg, m.keys.tempAdd):
screen.Clear()
screen.MoveTopLeft()
sub_model = tempAuthorModel(&m)
return m, tea.ClearScreen
case key.Matches(msg, m.keys.createAuthor):
screen.Clear()
screen.MoveTopLeft()
sub_model = createAuthorModel(&m)
return m, tea.ClearScreen
case key.Matches(msg, m.keys.deleteAuthor):