Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Fix the error in the event Badge (#397)
Browse files Browse the repository at this point in the history
which currently does not allow empty strings. Change it to use a String pointer.

Co-authored-by: ken <[email protected]>
  • Loading branch information
kfrico and ken authored Oct 18, 2023
1 parent e849f62 commit 1082851
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dock.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (d *Dock) SetBadge(badge string) (err error) {
if err = d.ctx.Err(); err != nil {
return
}
_, err = synchronousEvent(d.ctx, d, d.w, Event{Name: eventNameDockCmdSetBadge, TargetID: d.id, Badge: badge}, eventNameDockEventBadgeSet)
_, err = synchronousEvent(d.ctx, d, d.w, Event{Name: eventNameDockCmdSetBadge, TargetID: d.id, Badge: &badge}, eventNameDockEventBadgeSet)
return
}

Expand Down
2 changes: 1 addition & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Event struct {
// A choice was made not to use interfaces since it's a pain in the ass asserting each an every payload afterwards
// We use pointers so that omitempty works
AuthInfo *EventAuthInfo `json:"authInfo,omitempty"`
Badge string `json:"badge,omitempty"`
Badge *string `json:"badge,omitempty"`
BounceType string `json:"bounceType,omitempty"`
Bounds *RectangleOptions `json:"bounds,omitempty"`
CallbackID string `json:"callbackId,omitempty"`
Expand Down

0 comments on commit 1082851

Please sign in to comment.