commit 92851c6c56341553f7e6efe26d6f85136b7ce679
parent 4f76e2711583dd0eaee1c9f811add4ec024ea921
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Fri, 17 Jan 2025 16:05:32 +0800
notify: [darwin] fixup default and text actions
Text action doesn't need to encode the callback ID, and the default
action needs to be named.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/notify_darwin.go b/notify_darwin.go
@@ -24,6 +24,10 @@ func setup(cfg Config) error {
actionID := decode(actionIDEncoded)
actionArgs := decode(actionArgsEncoded)
+ if args.Action == defaultAction {
+ actionID = "default"
+ }
+
if args.UserText != "" {
actionArgs = args.UserText
}
@@ -59,7 +63,7 @@ func push(n Notification) (err error) {
for _, input := range n.TextActions {
inputs = append(inputs, darwinnotify.TextInputAction{
- ID: fmt.Sprintf("%d-%s", id, encode(input.ID)),
+ ID: encode(input.ID),
Title: input.Title,
Placeholder: input.PlaceholderHint,
ButtonTitle: input.ButtonLabel,