go-nativenotify

Native notifications in Go
Log | Files | Refs | README | LICENSE

commit 96f5fd4161456fb4aa7ee77c83e71d30acad1976
parent 9a5bdab562132f036f0c8543f3664b47e8bc6f26
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date:   Fri, 17 Jan 2025 14:59:07 +0800

notify: [darwin] allow for empty icon value

We don't want to supply a bogus icon value as that causes an error.

Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>

Diffstat:
Mnotify_darwin.go | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/notify_darwin.go b/notify_darwin.go @@ -74,10 +74,16 @@ func push(n Notification) (err error) { }) } + var attachments []string + + if n.Icon != "" { + attachments = []string{n.Icon} + } + darwinnotify.Notify(darwinnotify.Notification{ Title: n.Title, Body: n.Body, - Attachments: []string{n.Icon}, + Attachments: attachments, Actions: buttons, TextInputActions: inputs, UserData: userData,