summaryrefslogtreecommitdiff
path: root/source/features/batch-open-issues.tsx
diff options
context:
space:
mode:
authorGravatar Flo Edelmann <florian-edelmann@online.de> 2020-05-06 22:18:26 +0200
committerGravatar GitHub <noreply@github.com> 2020-05-06 22:18:26 +0200
commitf7aa9d34b9c6d77faa68869b9bc8e77354e31c3a (patch)
treebf7f4b30e2a9b8d5746634d1ea195992350c2ee5 /source/features/batch-open-issues.tsx
parent935040f7b434c8e6c54e9a6f8c3b07783a1fdc1f (diff)
downloadrefined-github-f7aa9d34b9c6d77faa68869b9bc8e77354e31c3a.tar.gz
refined-github-f7aa9d34b9c6d77faa68869b9bc8e77354e31c3a.tar.zst
refined-github-f7aa9d34b9c6d77faa68869b9bc8e77354e31c3a.zip
Make `batch-open-issues` faster (#3059)
Diffstat (limited to 'source/features/batch-open-issues.tsx')
-rw-r--r--source/features/batch-open-issues.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/features/batch-open-issues.tsx b/source/features/batch-open-issues.tsx
index ce87c81a..10b5ade9 100644
--- a/source/features/batch-open-issues.tsx
+++ b/source/features/batch-open-issues.tsx
@@ -1,6 +1,7 @@
import React from 'dom-chef';
import select from 'select-dom';
import delegate from 'delegate-it';
+import elementReady from 'element-ready';
import features from '../libs/features';
import * as pageDetect from '../libs/page-detect';
@@ -32,8 +33,8 @@ function openIssues(): void {
});
}
-function init(): void | false {
- if (select.all('.js-issue-row').length < 2) {
+async function init(): Promise<void | false> {
+ if (!await elementReady('.js-issue-row + .js-issue-row')) {
return false;
}
@@ -72,5 +73,6 @@ features.add({
include: [
pageDetect.isDiscussionList
],
+ waitForDomReady: false,
init
});