Skip to content

Commit

Permalink
Use app ID not string 'appID'
Browse files Browse the repository at this point in the history
This needs a more complete fix when we have an app name
  • Loading branch information
andydotxyz committed Feb 15, 2021
1 parent 50d0c51 commit 1ac1d1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/app_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $toastXml.GetElementsByTagName("text")[1].AppendChild($toastXml.CreateTextNode($
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($toastXml.OuterXml)
$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("appID").Show($toast);`
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("%s").Show($toast);`

func isDark() bool {
k, err := registry.OpenKey(registry.CURRENT_USER, `SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize`, registry.QUERY_VALUE)
Expand Down Expand Up @@ -74,8 +74,12 @@ var scriptNum = 0
func (app *fyneApp) SendNotification(n *fyne.Notification) {
title := escapeNotificationString(n.Title)
content := escapeNotificationString(n.Content)
appID := app.UniqueID() // TODO once we have an app name compiled in this could be improved
if appID == "" || strings.Index(appID, "missing-id") == 0 {
appID = "Fyne app"
}

script := fmt.Sprintf(notificationTemplate, title, content)
script := fmt.Sprintf(notificationTemplate, title, content, appName)
go runScript("notify", script)
}

Expand Down

0 comments on commit 1ac1d1d

Please sign in to comment.