Skip to content

Commit

Permalink
Merge branch 'Fix-badge'
Browse files Browse the repository at this point in the history
  • Loading branch information
raykov committed Aug 14, 2020
2 parents 05ae10e + 0ae84e9 commit 80b286b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions js/providers/azure.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Azure {
return
}

window.requestsData.setLoadingBadge();
window.requestsData.setProviderLoading(self.name);

if (self.configuration.token === "" || self.configuration.token === null || self.configuration.token === undefined) {
Expand Down
1 change: 1 addition & 0 deletions js/providers/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Github {
return
}

window.requestsData.setLoadingBadge();
window.requestsData.setProviderLoading(self.name);
window.requestsData.resetProviderData(self.name)

Expand Down
7 changes: 5 additions & 2 deletions js/requests-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,17 @@ class RequestsData {
return Object.keys(this.loading).length > 0
}

setProviderLoading(provider) {
setLoadingBadge() {
this.badge.loading();
}

setProviderLoading(provider) {
if (this.loading[provider] === undefined) this.loading[provider] = 0;
this.loading[provider] ++;
}

setProviderLoaded(provider) {
this.loading[provider] --;
if (this.loading[provider] > 0) this.loading[provider] --;
if (this.loading[provider] < 1) delete this.loading[provider];
}

Expand Down
8 changes: 5 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "Github review requests list",
"version": "0.6.0",
"description": "Github review requests list",
"name": "Github and Azure review requests list",
"short_name": "Review requests list",
"author": "Andrii Raikov",
"version": "0.7.0",
"description": "Github and Azure review requests list",
"manifest_version": 2,
"background": {
"persistent": false,
Expand Down

0 comments on commit 80b286b

Please sign in to comment.