Skip to content

Any tips on how to implement a "decrement" badge option? #4431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SebC99 opened this issue Dec 18, 2017 · 1 comment
Closed

Any tips on how to implement a "decrement" badge option? #4431

SebC99 opened this issue Dec 18, 2017 · 1 comment

Comments

@SebC99
Copy link
Contributor

SebC99 commented Dec 18, 2017

I would like to do a PR to allow for a "decrement" badge option in push controller.
Adding a

if (typeof badge == 'string' && badge.toLowerCase() === 'decrement') {
  restUpdate = { badge: { __op: 'Increment', amount: -1 } }
}

is easy, by I guess we should take care of zero values, to avoid negative badge value.
Do you have any idea how I could implement this?
Or what would be the best way to have a decrement option in push controller?
(It would great to cancel a notification like an invite for example)

Thanks

@stale
Copy link

stale bot commented Sep 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant