aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/display-window.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/display-window.js')
-rw-r--r--ext/bg/js/display-window.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/bg/js/display-window.js b/ext/bg/js/display-window.js
index e5357bf9..1f607510 100644
--- a/ext/bg/js/display-window.js
+++ b/ext/bg/js/display-window.js
@@ -37,11 +37,15 @@ window.displayWindow = new class extends Display {
$('#query').focus().select();
}
- onSearch(e) {
+ async onSearch(e) {
e.preventDefault();
- $('#intro').slideUp();
- instYomi().termsFind($('#query').val()).then(({length, definitions}) => {
- super.showTermDefs(definitions, instYomi().options);
- }).catch(this.handleError.bind(this));
+
+ try {
+ $('#intro').slideUp();
+ const {length, definitions} = await apiTermsFind($('#query').val());
+ super.showTermDefs(definitions, await apiOptionsGet());
+ } catch (e) {
+ this.handleError(e);
+ }
}
};