Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Steinke committed Feb 22, 2024
1 parent 08994dc commit 8d96394
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ui/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ type barChart struct {

func (c *barChart) OnMount(ctx app.Context) {
ctx.After(50*time.Millisecond, func(ctx app.Context) {
ctx.Defer(func(ctx app.Context) {
ctx.Defer(func(_ app.Context) {
c.eChartsInstance = app.Window().Get("echarts").
Call("init", c.JSValue(), c.Bar.Theme)
c.UpdateBarChart(ctx, c.Bar)
c.UpdateBarChart(c.Bar)
})
})
ctx.Handle(storage.EventScoreUpdate, c.HandleScoreUpdate)
}

func (c *barChart) HandleScoreUpdate(ctx app.Context, a app.Action) {
func (c *barChart) HandleScoreUpdate(_ app.Context, a app.Action) {
s, ok := a.Value.(storage.Scores)
if !ok {
fmt.Println("wrong type")
return
}
c.UpdateBarChart(ctx, newBarChart(s.Endless))
c.UpdateBarChart(newBarChart(s.Endless))
}

func (c *barChart) OnDismount() {
Expand All @@ -104,7 +104,7 @@ func (c *barChart) OnDismount() {
}
}

func (c *barChart) UpdateBarChart(ctx app.Context, config *charts.Bar) {
func (c *barChart) UpdateBarChart(config *charts.Bar) {
config.Validate()
c.Bar = config

Expand Down
1 change: 1 addition & 0 deletions ui/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (g *menu) storeSpeed(ctx app.Context, _ app.Event) {
g.selectedSpeed = s
}

// NewGameSettings are the settings of a new game that gets published to the logic
type NewGameSettings struct {
Speed storage.Speed
Difficulty storage.Difficulty
Expand Down
2 changes: 1 addition & 1 deletion ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (u *UI) onUpdateClick(ctx app.Context, _ app.Event) {
ctx.Reload()
}

func (u *UI) handleStateChange(ctx app.Context, a app.Action) {
func (u *UI) handleStateChange(_ app.Context, a app.Action) {
txt, ok := a.Value.(string)
if !ok {
fmt.Println("wrong type")
Expand Down

0 comments on commit 8d96394

Please sign in to comment.