Skip to content

Commit

Permalink
fix: udpdate Bubbles API
Browse files Browse the repository at this point in the history
  • Loading branch information
CamiloGarciaLaRotta committed Nov 11, 2020
1 parent 6e41a01 commit ebb88d0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func countDown() tea.Cmd {

func (m model) Init() tea.Cmd {
cmds := []tea.Cmd{
input.Blink(m.textInput),
spinner.Tick(m.spinner),
input.Blink,
spinner.Tick,
}

if m.timeMode {
Expand All @@ -151,7 +151,7 @@ func (m model) Init() tea.Cmd {

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var spinnerCmd tea.Cmd
m.spinner, spinnerCmd = spinner.Update(msg, m.spinner)
m.spinner, spinnerCmd = m.spinner.Update(msg)
cmds := []tea.Cmd{spinnerCmd}

switch msg := msg.(type) {
Expand Down Expand Up @@ -190,7 +190,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

default:
var inputCmd tea.Cmd
m.textInput, inputCmd = input.Update(msg, m.textInput)
m.textInput, inputCmd = m.textInput.Update(msg)
cmds = append(cmds, inputCmd)
}
}
Expand All @@ -213,7 +213,7 @@ func (m model) View() string {
}

s := termenv.
String(spinner.View(m.spinner)).
String(m.spinner.View()).
Foreground(term.Color("205")).
String()

Expand All @@ -223,11 +223,11 @@ func (m model) View() string {
)

if m.timeMode {
timedOutput := fmt.Sprintf("%s%s\n %s\n%s\n%s\n%s\n", s, timerText, m.currentWord, input.View(m.textInput), m.status, quitMsg)
timedOutput := fmt.Sprintf("%s%s\n %s\n%s\n%s\n%s\n", s, timerText, m.currentWord, m.textInput.View(), m.status, quitMsg)
return timedOutput
}

nonTimedOutput := fmt.Sprintf("%s%s\n%s\n%s\n%s\n", s, m.currentWord, input.View(m.textInput), m.status, quitMsg)
nonTimedOutput := fmt.Sprintf("%s%s\n%s\n%s\n%s\n", s, m.currentWord, m.textInput.View(), m.status, quitMsg)
return nonTimedOutput
}

Expand Down

0 comments on commit ebb88d0

Please sign in to comment.