summaryrefslogtreecommitdiffstats
path: root/extensions/ComponentWatching
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-08-04 18:27:51 +0200
committerDylan William Hardison <dylan@hardison.net>2018-08-04 18:27:51 +0200
commitfc4c941f8c4b8f5ef6036f555703050899e241c2 (patch)
tree595df48facd20c4f0f2104e44fed95bdb8463cff /extensions/ComponentWatching
parentf44392e8cdbea85ac308b2472f813ee605ebae4b (diff)
parent43837b61eaf9bc76adadbf8b515522bdb757c67b (diff)
downloadbugzilla-fc4c941f8c4b8f5ef6036f555703050899e241c2.tar.gz
bugzilla-fc4c941f8c4b8f5ef6036f555703050899e241c2.tar.xz
Merge branch 'mojo-poc'
Diffstat (limited to 'extensions/ComponentWatching')
-rw-r--r--extensions/ComponentWatching/web/js/overlay.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/extensions/ComponentWatching/web/js/overlay.js b/extensions/ComponentWatching/web/js/overlay.js
index c0c540257..622749852 100644
--- a/extensions/ComponentWatching/web/js/overlay.js
+++ b/extensions/ComponentWatching/web/js/overlay.js
@@ -22,7 +22,12 @@ Bugzilla.ComponentWatching = class ComponentWatching {
constructor() {
this.buttons = document.querySelectorAll('button.component-watching');
- this.init();
+ // Check if the user is logged in and the API key is available. If not, remove the Watch buttons.
+ if (BUGZILLA.api_token) {
+ this.init();
+ } else {
+ this.buttons.forEach($button => $button.remove());
+ }
}
/**