Skip to content

Commit

Permalink
Fix clicking seen notification decrementing unread count
Browse files Browse the repository at this point in the history
  • Loading branch information
sahandseifi committed Apr 30, 2024
1 parent 889ee80 commit e7ff155
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notificationapi-js-client-sdk",
"version": "4.6.0",
"version": "4.6.1",
"description": "NotificationAPI client-side library for JavaScript",
"keywords": [
"notificationapi",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,8 @@ class NotificationAPIClient implements NotificationAPIClientInterface {

if (!menuWasClicked) {
notification.classList.remove('unseen');
this.setInAppUnread(this.state.unread - 1);
/* istanbul ignore next */
if (!n.seen) this.setInAppUnread(this.state.unread - 1);
this.sendWSMessage({
route: 'inapp_web/unread_clear',
payload: {
Expand Down

0 comments on commit e7ff155

Please sign in to comment.