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

Commit

Permalink
Only show desktop notification if sync produced any differences (gopa…
Browse files Browse the repository at this point in the history
…sspw#2627)

This simple change will suppress the desktop notification if the diff is
zero. Please note that this is not perfect since an even number of
additions and removals might add up to zero.

Fixes gopasspw#2618

Signed-off-by: Dominik Schulz <[email protected]>
  • Loading branch information
dominikschulz authored Jul 30, 2023
1 parent 45aca2a commit c0c3336
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/action/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ func (s *Action) sync(ctx context.Context, store string) error {
} else if numEntries < 0 {
diff = fmt.Sprintf(" Removed %d entries", -1*numEntries)
}
_ = notify.Notify(ctx, "gopass - sync", fmt.Sprintf("Finished. Synced %d remotes.%s", numMPs, diff))

if numEntries != 0 {
_ = notify.Notify(ctx, "gopass - sync", fmt.Sprintf("Finished. Synced %d remotes.%s", numMPs, diff))
}

return nil
}
Expand Down

0 comments on commit c0c3336

Please sign in to comment.