Move initialization of selectedMonth and selectedDay inside periodic update loop in YearMood widget
This commit is contained in:
parent
d2500351f9
commit
af5a39ef75
@ -30,10 +30,9 @@ func YearMood() YearMoodOptions {
|
||||
func createYearMood(ctx context.Context, _ terminalapi.Terminal, _ interface{}) widgetapi.Widget {
|
||||
widget := util.PanicOnErrorWithResult(NewMoodText())
|
||||
|
||||
go util.Periodic(ctx, 1*time.Hour, func() error {
|
||||
widget.selectedMonth = time.Now().Month()
|
||||
widget.selectedDay = time.Now().Day()
|
||||
|
||||
go util.Periodic(ctx, 1*time.Hour, func() error {
|
||||
return widget.drawTable()
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user