From d7e1ef01d8af4a315a31364eb5138e24a132ea1e Mon Sep 17 00:00:00 2001 From: siikamiika Date: Thu, 13 Feb 2020 16:26:45 +0200 Subject: use Promise.all to await dependencies --- ext/mixed/js/display.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/mixed/js') 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)); } -- cgit v1.2.3