Skip to content

Native Notifications #57

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

Merged
merged 14 commits into from
Jun 14, 2015
Merged

Native Notifications #57

merged 14 commits into from
Jun 14, 2015

Conversation

manosim
Copy link
Member

@manosim manosim commented Jun 12, 2015

Review after #56 .

screen shot 2015-06-13 at 01 40 03

screen shot 2015-06-13 at 01 31 08

@manosim manosim added this to the Release 0.0.13 milestone Jun 13, 2015
@manosim manosim mentioned this pull request Jun 13, 2015
if (!playSound && !showNotifications) { return; }

// Check if notification is already in the store.
var countNew = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This keeps the functions more pure, and I believe correctly picks the latest notification. I think the existing code would get the last of the new notifications.

// Check if notification is already in the store.
var newNotifications = _.filter(response, function (obj) {
  return !_.contains(self._previousNotifications, obj.id);
});

// Play Sound / Show Notification.
if (newNotifications && newNotifications.length) {
  if (playSound) {
    self.playSound();
  }
  if (showNotifications) {
    this.showNotification(countNew, response, {
      full_name: newNotifications[0].repository.full_name,
      subject: newNotifications[0].subject.title
    });
  }
}

@JakeSidSmith
Copy link
Collaborator

🚀

manosim pushed a commit that referenced this pull request Jun 14, 2015
@manosim manosim merged commit ec15749 into master Jun 14, 2015
@manosim manosim deleted the native-notifications branch June 14, 2015 18:38
@manosim manosim added release Release and removed review needed labels Jun 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release Release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants