Skip to content

Commit

Permalink
fix greeting command (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Sep 2, 2023
1 parent cf85f1f commit 39faf09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ui/cmd/greeting/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case "ctrl+c", "q":
return m, tea.Quit
case "enter":
if m.err != nil {
return m, tea.Quit
}

switch m.phase {
case questionPhase:
m.qaList[m.questionIndex].answer = m.TextInput.Value()
Expand Down
2 changes: 1 addition & 1 deletion ui/cmd/greeting/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func (m *Model) View() string {
if m.err != nil {
return style.ErrorView(m.Window.Width, m.Window.Height)
return style.ErrorView(style.DefaultErrorMessage, m.Window.Width, m.Window.Height)
}
return lipgloss.Place(m.Window.Width, m.Window.Height, lipgloss.Center, lipgloss.Center,
lipgloss.JoinVertical(
Expand Down

0 comments on commit 39faf09

Please sign in to comment.