commit 6327a248eff77b497723a84682896f8862e16845 parent 4d4e3c9cb6bf6cdfc965761eee9e9e70fd18a9a3 Author: Jack Mordaunt <jackmordaunt.dev@gmail.com> Date: Wed, 22 Mar 2023 13:58:36 +0800 toast: remove superfluous constant Foreground and Background are treated identically for our purposes. Therefore we can simplify things by removing on of the options. https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/send-local-toast-desktop-cpp-wrl#foreground-vs-background-activation Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com> Diffstat:
| M | constants.go | | | 8 | +++++--- |
| M | toast.go | | | 2 | +- |
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/constants.go b/constants.go @@ -56,8 +56,10 @@ type ActivationType = string const ( // Protocol is for launching third-party applications using a protocol uri, like https or mailto. Protocol ActivationType = "protocol" - // Foreground is for launching your foreground application. + // Foreground is for launching your foreground application. This is required to enable the activation + // callback. There is a third option: Background, however for Desktop applications Foreground and + // Background behave identically. + // + // See https://learn.microsoft.com/en-us/windows/apps/design/shell/tiles-and-notifications/send-local-toast-desktop-cpp-wrl#foreground-vs-background-activation Foreground ActivationType = "foreground" - // Background is for performing a background task. - Background ActivationType = "background" ) diff --git a/toast.go b/toast.go @@ -176,7 +176,7 @@ func (n *Notification) Push() error { func (n *Notification) applyDefaults() { if n.ActivationType == "" { - n.ActivationType = Protocol + n.ActivationType = Foreground } if n.Duration == "" { n.Duration = Short