[v3] bugfix/windows linux notifications (#4450)

* fix windows encoding

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
Zach Botterman 2025-07-30 05:40:58 -07:00 committed by GitHub
commit 48e3bd3dd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 17 deletions

View file

@ -23,6 +23,7 @@ After processing, the content will be moved to the main changelog and this file
## Fixed
<!-- Bug fixes -->
- Fixed notification parsing on Windows @popaprozac in [PR](https://github.com/wailsapp/wails/pull/4450)
## Deprecated
<!-- Soon-to-be removed features -->

View file

@ -177,13 +177,11 @@ func (wn *windowsNotifier) SendNotification(options NotificationOptions) error {
ActivationArguments: DefaultActionIdentifier,
}
if options.Data != nil {
encodedPayload, err := wn.encodePayload(DefaultActionIdentifier, options)
if err != nil {
return fmt.Errorf("failed to encode notification payload: %w", err)
}
n.ActivationArguments = encodedPayload
encodedPayload, err := wn.encodePayload(DefaultActionIdentifier, options)
if err != nil {
return fmt.Errorf("failed to encode notification payload: %w", err)
}
n.ActivationArguments = encodedPayload
return n.Push()
}
@ -232,20 +230,18 @@ func (wn *windowsNotifier) SendNotificationWithActions(options NotificationOptio
})
}
if options.Data != nil {
encodedPayload, err := wn.encodePayload(n.ActivationArguments, options)
encodedPayload, err := wn.encodePayload(n.ActivationArguments, options)
if err != nil {
return fmt.Errorf("failed to encode notification payload: %w", err)
}
n.ActivationArguments = encodedPayload
for index := range n.Actions {
encodedPayload, err := wn.encodePayload(n.Actions[index].Arguments, options)
if err != nil {
return fmt.Errorf("failed to encode notification payload: %w", err)
}
n.ActivationArguments = encodedPayload
for index := range n.Actions {
encodedPayload, err := wn.encodePayload(n.Actions[index].Arguments, options)
if err != nil {
return fmt.Errorf("failed to encode notification payload: %w", err)
}
n.Actions[index].Arguments = encodedPayload
}
n.Actions[index].Arguments = encodedPayload
}
return n.Push()