When Chrome is launched, we check each project for PRs and notify accordingly, this possibly is not expected behaviour, if a users is watching several projects with many PRs, notifications could be exponential and very annoying.
We should add logic to ensure the first call to ghpr.getData() in background/background.js doesn't raise notifications.
Steps to implement:
Pass a parameter of true to ghpr.getData() in background/background.js as follows: ghpr.getData(true)
Change GitHubPullRequestNotifier.prototype.getData = function(){ to allow for the above parameter to be passed in background/background.js as follows GitHubPullRequestNotifier.prototype.getData = function(initialLaunch){
Pass initialLaunch variable to _this.parseDatabackground/background.js as follows _this.parseData(this.response, project.org, project.repo, initialLaunch);
Modify if(this.currentPullRequests.indexOf(div.text.trim()) === -1){ to check against initialLaunch !== truebackground/background.js as follows: if(this.currentPullRequests.indexOf(div.text.trim()) === -1 && initialLaunch !== true){
When Chrome is launched, we check each project for PRs and notify accordingly, this possibly is not expected behaviour, if a users is watching several projects with many PRs, notifications could be exponential and very annoying.
We should add logic to ensure the first call to ghpr.getData() in
background/background.js
doesn't raise notifications.Steps to implement:
ghpr.getData()
in background/background.js as follows:ghpr.getData(true)
GitHubPullRequestNotifier.prototype.getData = function(){
to allow for the above parameter to be passed in background/background.js as followsGitHubPullRequestNotifier.prototype.getData = function(initialLaunch){
initialLaunch
variable to_this.parseData
background/background.js as follows_this.parseData(this.response, project.org, project.repo, initialLaunch);
if(this.currentPullRequests.indexOf(div.text.trim()) === -1){
to check againstinitialLaunch !== true
background/background.js as follows:if(this.currentPullRequests.indexOf(div.text.trim()) === -1 && initialLaunch !== true){