summaryrefslogtreecommitdiff
path: root/ext/mixed
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-02-13 16:26:45 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-02-13 16:26:45 +0200
commitd7e1ef01d8af4a315a31364eb5138e24a132ea1e (patch)
treee436e9fe0ffee2d7290ca737bcd5014a2ae61822 /ext/mixed
parent38a6433a46a4259666864a57c5adbd58cb59db86 (diff)
use Promise.all to await dependencies
Diffstat (limited to 'ext/mixed')
-rw-r--r--ext/mixed/js/display.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index b524fe34..d49c205e 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -44,8 +44,9 @@ class Display {
}
async prepare(options=null) {
- await this.displayGenerator.prepare();
- await this.updateOptions(options);
+ const displayGeneratorPromise = this.displayGenerator.prepare();
+ const updateOptionsPromise = this.updateOptions(options);
+ await Promise.all([displayGeneratorPromise, updateOptionsPromise]);
yomichan.on('optionsUpdate', () => this.updateOptions(null));
}