aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-10 20:46:30 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-10 21:58:53 -0400
commit84bd9ff93b15f419ce1076b7545aeb406917f9b5 (patch)
tree8374573a36784ce12abb7b490ccd9791aea3f2e3 /ext/bg/js/backend.js
parent71b700cd22f5a57a07cd2f9a6afa823793f5f95e (diff)
Update settings if a different source triggers optionsUpdate
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 4763e85d..9a300d62 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -35,7 +35,7 @@ class Backend {
async prepare() {
await this.translator.prepare();
this.options = await optionsLoad();
- this.onOptionsUpdated();
+ this.onOptionsUpdated('background');
if (chrome.commands !== null && typeof chrome.commands === 'object') {
chrome.commands.onCommand.addListener(this.onCommand.bind(this));
@@ -52,13 +52,13 @@ class Backend {
this.isPreparedPromise = null;
}
- onOptionsUpdated() {
+ onOptionsUpdated(source) {
this.applyOptions();
const callback = () => this.checkLastError(chrome.runtime.lastError);
chrome.tabs.query({}, tabs => {
for (const tab of tabs) {
- chrome.tabs.sendMessage(tab.id, {action: 'optionsUpdate', params: {}}, callback);
+ chrome.tabs.sendMessage(tab.id, {action: 'optionsUpdate', params: {source}}, callback);
}
});
}