File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ type model struct {
18
18
currentIdx int
19
19
errorMsg string
20
20
isLoading bool
21
+ animationIdx int
21
22
messages []string
22
23
}
23
24
@@ -70,6 +71,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
70
71
case tea .KeyCtrlC , tea .KeyEsc :
71
72
return m , tea .Quit
72
73
}
74
+ case tea.Cmd :
75
+ if m .isLoading {
76
+ m .animationIdx = (m .animationIdx + 1 ) % 3
77
+ }
73
78
}
74
79
return m , nil
75
80
}
@@ -80,7 +85,9 @@ func (m model) View() string {
80
85
return fmt .Sprintf (red (m .errorMsg ))
81
86
}
82
87
if m .isLoading {
83
- return "🌎 Generating commit messages ..."
88
+ AnimationEarth := []string {"🌎" ,"🌍" ,"🌏" }
89
+ AnimationPoint := []string {"." ,".." ,"..." }
90
+ return fmt .Sprintf ("%s Generating commit messages %s" , AnimationEarth [m .animationIdx ], AnimationPoint [m .animationIdx ])
84
91
}
85
92
var b strings.Builder
86
93
if m .errorMsg != "" {
You can’t perform that action at this time.
0 commit comments