Skip to content

Commit

Permalink
Merge pull request #5 from awendt/fix-notifications-for-reassigned-prs
Browse files Browse the repository at this point in the history
fix: reducer.notificationsForReassignedPRs checks for null
  • Loading branch information
awendt authored Nov 9, 2024
2 parents 27692c0 + 63f6e53 commit 24d3d19
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/notification-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class NotificationReducer {

get notificationsForReassignedPRs() {
return this.notificationsWithPullRequests.filter((notification) => {
return notification.reason === "subscribed" && notification.pull_request.assignee != this.me && notification.pull_request.assignee != ""
return notification.reason === "subscribed" && notification.pull_request.assignee != this.me && notification.pull_request.assignee !== null
});
}

Expand Down
1 change: 1 addition & 0 deletions test/fixtures/pr21.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"number": 21,
"state": "closed",
"title": "Add support for resource-specific tags",
"assignee": null,
"user": {
"login": "jansiwy",
"id": 610800,
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/pr45.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"number": 45,
"state": "open",
"title": "Breaking change: Unify support for resource-specific tags",
"assignee": "jansiwy",
"user": {
"login": "jansiwy",
"id": 610800,
Expand Down
1 change: 1 addition & 0 deletions test/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('Reducer', async () => {
'number',
'state',
'title',
'assignee',
'user',
'body',
'created_at',
Expand Down

0 comments on commit 24d3d19

Please sign in to comment.