Use promiseTimeout instead of delay

This commit is contained in:
toasted-nutbread 2020-02-15 20:35:51 -05:00
parent 496d2599ea
commit c5cbf99e89

View File

@ -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) {