diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-01-25 22:18:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-25 22:18:31 -0500 |
commit | 34fed22ccb34720a16097baebc25fe96278be93c (patch) | |
tree | 3ec06b9fabf42b3bf4a1f29c823a4a0cec6d7b5e /ext/bg/js/search.js | |
parent | 981f73b5623249b4c4cead0261eab0e70f620d90 (diff) |
Fix clipboard monitor not persisting (#1315)
* Add optionsUpdated event to Display
* Update this._clipboardMonitorEnabled
* Update settings to ensure no unexpected behaviour
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r-- | ext/bg/js/search.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 0fcbcd13..3b7e8299 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -54,6 +54,7 @@ class DisplaySearch extends Display { await this.updateOptions(); yomichan.on('optionsUpdated', this._onOptionsUpdated.bind(this)); + this.on('optionsUpdated', this._onDisplayOptionsUpdated.bind(this)); this.on('contentUpdating', this._onContentUpdating.bind(this)); this.on('modeChange', this._onModeChange.bind(this)); @@ -76,6 +77,7 @@ class DisplaySearch extends Display { this.hotkeyHandler.on('keydownNonHotkey', this._onKeyDown.bind(this)); this._onModeChange(); + this._onDisplayOptionsUpdated(); this.initializeState(); @@ -123,6 +125,11 @@ class DisplaySearch extends Display { } } + _onDisplayOptionsUpdated({options}) { + this._clipboardMonitorEnabled = options.general.enableClipboardMonitor; + this._updateClipboardMonitorEnabled(); + } + _onContentUpdating({type, content, source}) { let animate = false; let valid = false; |