From c1230d4b86d7d559e3789e1a48ad8cf01c35de24 Mon Sep 17 00:00:00 2001 From: Zach Botterman Date: Sun, 23 Feb 2025 14:37:03 -0800 Subject: [PATCH] update win impl to match --- v3/pkg/services/notifications/notifications.go | 14 +++++++------- .../notifications/notifications_windows.go | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/v3/pkg/services/notifications/notifications.go b/v3/pkg/services/notifications/notifications.go index 461f0b395..57715b11e 100644 --- a/v3/pkg/services/notifications/notifications.go +++ b/v3/pkg/services/notifications/notifications.go @@ -5,16 +5,16 @@ type Service struct { // NotificationAction represents an action button for a notification type NotificationAction = struct { - ID string `json:"id"` - Title string `json:"title"` + ID string `json:"id,omitempty"` + Title string `json:"title,omitempty"` Destructive bool `json:"destructive,omitempty"` AuthenticationRequired bool `json:"authenticationRequired,omitempty"` } // NotificationCategory groups actions for notifications type NotificationCategory = struct { - ID string `json:"id"` - Actions []NotificationAction `json:"actions"` + ID string `json:"id,omitempty"` + Actions []NotificationAction `json:"actions,omitempty"` HasReplyField bool `json:"hasReplyField,omitempty"` ReplyPlaceholder string `json:"replyPlaceholder,omitempty"` ReplyButtonTitle string `json:"replyButtonTitle,omitempty"` @@ -22,10 +22,10 @@ type NotificationCategory = struct { // NotificationOptions contains configuration for a notification type NotificationOptions = struct { - ID string `json:"id"` - Title string `json:"title"` + ID string `json:"id,omitempty"` + Title string `json:"title,omitempty"` Subtitle string `json:"subtitle,omitempty"` - Body string `json:"body"` + Body string `json:"body,omitempty"` CategoryID string `json:"categoryId,omitempty"` Data map[string]interface{} `json:"data,omitempty"` } diff --git a/v3/pkg/services/notifications/notifications_windows.go b/v3/pkg/services/notifications/notifications_windows.go index d88e06f9c..f279f67be 100644 --- a/v3/pkg/services/notifications/notifications_windows.go +++ b/v3/pkg/services/notifications/notifications_windows.go @@ -71,11 +71,11 @@ func (ns *Service) CheckNotificationAuthorization() bool { // SendNotification sends a basic notification with a name, title, and body. // (subtitle is only available on macOS) -func (ns *Service) SendNotification(identifier, title, _, body string) error { +func (ns *Service) SendNotification(options NotificationOptions) error { n := toast.Notification{ - AppID: identifier, - Title: title, - Body: body, + AppID: options.ID, + Title: options.Title, + Body: options.Body, } err := n.Push()