summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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());
+ }
}
/**