From d4b9cd042f2defb502ec622ce52e3f321cfc7ee0 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Mon, 20 Feb 2023 13:30:02 +0800 Subject: Run 50 more features before the whole page has loaded (#6357) --- source/features/patch-diff-links.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/features/patch-diff-links.tsx') 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 { 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( patch {' '} -- cgit v1.2.3