aboutsummaryrefslogtreecommitdiff
path: root/ext/fg/js/frontend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js/frontend.js')
-rw-r--r--ext/fg/js/frontend.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/fg/js/frontend.js b/ext/fg/js/frontend.js
index 52620933..83e0cef1 100644
--- a/ext/fg/js/frontend.js
+++ b/ext/fg/js/frontend.js
@@ -261,11 +261,8 @@ class Frontend {
onBgMessage({action, params}, sender, callback) {
const handlers = {
- optionsSet: ({options}) => {
- this.options = options;
- if (!this.options.enable) {
- this.searchClear();
- }
+ optionsUpdate: () => {
+ this.updateOptions();
},
popupSetVisible: ({visible}) => {
@@ -284,6 +281,13 @@ class Frontend {
console.log(error);
}
+ async updateOptions() {
+ this.options = await apiOptionsGet();
+ if (!this.options.enable) {
+ this.searchClear();
+ }
+ }
+
popupTimerSet(callback) {
this.popupTimerClear();
this.popupTimer = window.setTimeout(callback, this.options.scanning.delay);