summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-24 22:32:29 -0500
committerGitHub <noreply@github.com>2021-01-24 22:32:29 -0500
commitbab6c6fba9100ea01f4eb60dcc6960c5ed88c682 (patch)
treef4a235349f0f348203975457a0eec4538381300a /ext/bg/js/backend.js
parent4430446731b1bec045823103b6bfda485ce3ecf9 (diff)
Update badges (#1309)
* Update badge indications to be based off current profile * Update warning badge to display when no dictionaries are enabled * Show how many dictionaries are enabled
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 60739aab..fb0596d5 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -1248,14 +1248,17 @@ class Backend {
color = '#f0ad4e';
status = 'Loading';
}
- } else if (!this._anyOptionsMatches((options) => options.general.enable)) {
- text = 'off';
- color = '#555555';
- status = 'Disabled';
- } else if (!this._anyOptionsMatches((options) => this._isAnyDictionaryEnabled(options))) {
- text = '!';
- color = '#f0ad4e';
- status = 'No dictionaries installed';
+ } else {
+ const options = this._getProfileOptions({current: true});
+ if (!options.general.enable) {
+ text = 'off';
+ color = '#555555';
+ status = 'Disabled';
+ } else if (!this._isAnyDictionaryEnabled(options)) {
+ text = '!';
+ color = '#f0ad4e';
+ status = 'No dictionaries installed';
+ }
}
if (color !== null && typeof chrome.browserAction.setBadgeBackgroundColor === 'function') {