Skip to content

Commit

Permalink
enable notifications loop and more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Dec 13, 2023
1 parent 4821c25 commit 3259006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions desktop/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ func (app *App) beforeStart(listenAddr string) {
app.Exit(nil)
os.Exit(0)
}
app.AddExitFunc("stopping notifier", notifier.NotificationsLoop(app.analyticsSession))
}

func (app *App) isFeatureEnabled(features map[string]bool, feature string) bool {
Expand Down
3 changes: 3 additions & 0 deletions desktop/notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ var (
// ShowNotification submits the notification to the notificationsLoop to show
// and waits for the result.
func ShowNotification(note *notify.Notification, campaign string) bool {
log.Debug("Showing notification")
err := normalizeClickURL(note, campaign)
if err != nil {
log.Errorf("Could not normalize click URL: %v", err)
return false
}
chResult := make(chan bool)
Expand All @@ -46,6 +48,7 @@ func ShowNotification(note *notify.Notification, campaign string) bool {
func normalizeClickURL(note *notify.Notification, campaign string) error {
ga, err := analytics.AddCampaign(note.ClickURL, campaign, note.Title+"-"+note.Message, "notification")
if err != nil {
log.Errorf("Could not add campaign: %v", err)
return err
}

Expand Down

0 comments on commit 3259006

Please sign in to comment.