summaryrefslogtreecommitdiff
path: root/source/features/patch-diff-links.tsx
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2023-02-20 13:30:02 +0800
committerGravatar GitHub <noreply@github.com> 2023-02-20 13:30:02 +0800
commitd4b9cd042f2defb502ec622ce52e3f321cfc7ee0 (patch)
tree0b401070e2662c27a3372ad5d9d914ff21936248 /source/features/patch-diff-links.tsx
parentb9e20de6ab8dba8954dee9895572e8cb4cd00408 (diff)
downloadrefined-github-d4b9cd042f2defb502ec622ce52e3f321cfc7ee0.tar.gz
refined-github-d4b9cd042f2defb502ec622ce52e3f321cfc7ee0.tar.zst
refined-github-d4b9cd042f2defb502ec622ce52e3f321cfc7ee0.zip
Run 50 more features before the whole page has loaded (#6357)
Diffstat (limited to 'source/features/patch-diff-links.tsx')
-rw-r--r--source/features/patch-diff-links.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/features/patch-diff-links.tsx b/source/features/patch-diff-links.tsx
index a20f66ed..7a114634 100644
--- a/source/features/patch-diff-links.tsx
+++ b/source/features/patch-diff-links.tsx
@@ -1,11 +1,11 @@
import React from 'dom-chef';
-import select from 'select-dom';
+import elementReady from 'element-ready';
import * as pageDetect from 'github-url-detection';
import features from '../feature-manager';
import {getCleanPathname} from '../github-helpers';
-function init(): void {
+async function init(): Promise<void> {
let commitUrl = '/' + getCleanPathname();
// Avoids a redirection
@@ -13,9 +13,9 @@ function init(): void {
commitUrl = commitUrl.replace(/\/pull\/\d+\/commits/, '/commit');
}
- const commitMeta = select('.commit-meta')!;
- commitMeta.classList.remove('no-wrap'); // #5987
- commitMeta.lastElementChild!.append(
+ const commitMeta = await elementReady('.commit-meta')!;
+ commitMeta!.classList.remove('no-wrap'); // #5987
+ commitMeta!.lastElementChild!.append(
<span className="sha-block" data-turbo="false">
<a href={`${commitUrl}.patch`} className="sha">patch</a>
{' '}