Use promiseTimeout instead of delay
This commit is contained in:
parent
496d2599ea
commit
c5cbf99e89
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user