summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-10 20:04:28 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-10 21:44:32 -0400
commit87e513dd77ab228953449d534a989c8c68f39858 (patch)
treeec7bb5f61f7438980c0ff385eec45b6ec58bacac /ext/bg
parent1f8c7358cb017e0c96a454d9e9a1f53eb6d4fe15 (diff)
Fix options reference being changed
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/api.js2
-rw-r--r--ext/bg/js/backend.js6
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index a50353c1..13c0d73a 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -25,7 +25,7 @@ async function apiOptionsSave() {
const backend = utilBackend();
const options = await backend.getFullOptions();
await optionsSave(options);
- backend.onOptionsUpdated(options);
+ backend.onOptionsUpdated();
}
async function apiTermsFind(text, optionsContext) {
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 1f00f788..4763e85d 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -34,7 +34,8 @@ class Backend {
async prepare() {
await this.translator.prepare();
- this.onOptionsUpdated(await optionsLoad());
+ this.options = await optionsLoad();
+ this.onOptionsUpdated();
if (chrome.commands !== null && typeof chrome.commands === 'object') {
chrome.commands.onCommand.addListener(this.onCommand.bind(this));
@@ -51,8 +52,7 @@ class Backend {
this.isPreparedPromise = null;
}
- onOptionsUpdated(options) {
- this.options = utilIsolate(options);
+ onOptionsUpdated() {
this.applyOptions();
const callback = () => this.checkLastError(chrome.runtime.lastError);