Move initialization of selectedMonth and selectedDay inside periodic update loop in YearMood widget

This commit is contained in:
Arindy 2025-12-31 16:11:48 +01:00
parent d2500351f9
commit af5a39ef75

View File

@ -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()
})