aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js/display.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-15 20:35:51 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-15 20:35:51 -0500
commitc5cbf99e89a89bfb684964328db3093c7ce07fd7 (patch)
tree517b707cb8672b21cb4529603959e829c95a7188 /ext/mixed/js/display.js
parent496d2599ea6d9607b554641ded77cc82a6b9df42 (diff)
Use promiseTimeout instead of delay
Diffstat (limited to 'ext/mixed/js/display.js')
-rw-r--r--ext/mixed/js/display.js6
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 5c010747..400a83c0 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -707,7 +707,7 @@ class Display {
async getScreenshot() {
try {
await this.setPopupVisibleOverride(false);
- await Display.delay(1); // Wait for popup to be hidden.
+ await promiseTimeout(1); // Wait for popup to be hidden.
const {format, quality} = this.options.anki.screenshot;
const dataUrl = await apiScreenshotGet({format, quality});
@@ -784,10 +784,6 @@ class Display {
}
}
- static delay(time) {
- return new Promise((resolve) => setTimeout(resolve, time));
- }
-
static indexOf(nodeList, node) {
for (let i = 0, ii = nodeList.length; i < ii; ++i) {
if (nodeList[i] === node) {