Skip to content

Commit

Permalink
♻️ Improve switching between components
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelorant committed Jan 17, 2023
1 parent 591bba7 commit 151d18c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,14 @@ func (m Model) onKeyPress(msg tea.KeyMsg) keyResponse {
}
m.state = bodyComponent
case "enter":
if m.state == authorComponent {
switch m.state {
case authorComponent:
m.models.info, _ = info.ToModel(m.models.info.Update(msg))
m.state = emojiComponent
break
}
if m.state == emojiComponent {
case emojiComponent:
m.models.header, _ = header.ToModel(m.models.header.Update(msg))
m.state = summaryComponent
break
}
if m.state == summaryComponent {
case summaryComponent:
m.state = bodyComponent
}
case "alt+enter":
Expand Down

0 comments on commit 151d18c

Please sign in to comment.