diff options
Diffstat (limited to 'ext/fg')
-rw-r--r-- | ext/fg/js/frontend.js | 14 |
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); |