Skip to content

Commit

Permalink
Revert "Improve code style"
Browse files Browse the repository at this point in the history
This reverts commit fc1445a.

	modified:   internal/terminal/handler/error/error.go
  • Loading branch information
canack committed Sep 2, 2024
1 parent fc1445a commit 660ccd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 164 deletions.
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ module github.com/termkit/gama

go 1.22.6

replace (
github.com/termkit/skeleton => ../skeleton
)

require (
github.com/Masterminds/semver/v3 v3.3.0
github.com/charmbracelet/bubbles v0.19.0
Expand Down
155 changes: 0 additions & 155 deletions go.work.sum

This file was deleted.

13 changes: 8 additions & 5 deletions internal/terminal/handler/error/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,15 @@ func (m *ModelError) Update(msg tea.Msg) (*ModelError, tea.Cmd) {
case spinner.TickMsg:
m.spinner, cmd = m.spinner.Update(msg)
cmds = append(cmds, cmd)

cmds = append(cmds, m.SelfUpdater())
case UpdateSelf:
if msg.InProgress {
m.spinner, cmd = m.spinner.Update(m.spinner.Tick())
cmds = append(cmds, cmd)
}

cmds = append(cmds, m.SelfUpdater())
}

cmds = append(cmds, m.SelfUpdater())

return m, tea.Batch(cmds...)
}

Expand Down Expand Up @@ -122,7 +120,12 @@ func (m *ModelError) View() string {

func (m *ModelError) SelfUpdater() tea.Cmd {
return func() tea.Msg {
return <-m.updateChan
select {
case o := <-m.updateChan:
return o
default:
return nil
}
}
}

Expand Down

0 comments on commit 660ccd9

Please sign in to comment.