Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Revert icon fix for now
Browse files Browse the repository at this point in the history
  • Loading branch information
achhabra2 committed Jan 6, 2022
1 parent b1c2b3e commit dfb17d6
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,27 +456,31 @@ func (b *App) AppInstalledFromPackageManager() bool {
}

func (b *App) VerifyNotificationIcon() string {
if goruntime.GOOS == "windows" {
if b.UserPrefs.Notifications {
settingsDir, ferr := settings.GetSettingsDirectory()
if ferr != nil {
runtime.LogError(b.ctx, "Could not open settings directory")
return ""
}
notificationIconPath := filepath.Join(settingsDir, "notificationIcon.png")
if _, err := os.Stat(notificationIconPath); os.IsNotExist(err) {
runtime.LogInfo(b.ctx, "No notification icon found, creating..")
err = os.WriteFile(notificationIconPath, notificationIcon, 0666)
if err != nil {
runtime.LogError(b.ctx, "Could not write icon file")
return ""
}
return notificationIconPath
} else {
runtime.LogInfo(b.ctx, "Notification icon found, skipping")
return notificationIconPath
}
}
}
return ""
return "appicon.png"
}

// func (b *App) VerifyNotificationIcon() string {
// if goruntime.GOOS == "windows" {
// if b.UserPrefs.Notifications {
// settingsDir, ferr := settings.GetSettingsDirectory()
// if ferr != nil {
// runtime.LogError(b.ctx, "Could not open settings directory")
// return ""
// }
// notificationIconPath := filepath.Join(settingsDir, "notificationIcon.png")
// if _, err := os.Stat(notificationIconPath); os.IsNotExist(err) {
// runtime.LogInfo(b.ctx, "No notification icon found, creating..")
// err = os.WriteFile(notificationIconPath, notificationIcon, 0666)
// if err != nil {
// runtime.LogError(b.ctx, "Could not write icon file")
// return ""
// }
// return notificationIconPath
// } else {
// runtime.LogInfo(b.ctx, "Notification icon found, skipping")
// return notificationIconPath
// }
// }
// }
// return ""
// }

0 comments on commit dfb17d6

Please sign in to comment.