diff options
author | 2023-05-21 02:40:32 +0800 | |
---|---|---|
committer | 2023-05-21 02:40:32 +0800 | |
commit | 32e458ceda0607f6692cef01c68b9af57c826c6e (patch) | |
tree | f077067f06d1002eb768ebe7581540e1f9c86fad /source/features/wait-for-checks.tsx | |
parent | 7f6b216506e3e10743efb9b0ea2814d3b43a9270 (diff) | |
download | refined-github-32e458ceda0607f6692cef01c68b9af57c826c6e.tar.gz refined-github-32e458ceda0607f6692cef01c68b9af57c826c6e.tar.zst refined-github-32e458ceda0607f6692cef01c68b9af57c826c6e.zip |
Restore `wait-for-checks` (no more Firefox support) (#6673)23.5.20
Diffstat (limited to 'source/features/wait-for-checks.tsx')
-rw-r--r-- | source/features/wait-for-checks.tsx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/features/wait-for-checks.tsx b/source/features/wait-for-checks.tsx index c595fdcb..b1116731 100644 --- a/source/features/wait-for-checks.tsx +++ b/source/features/wait-for-checks.tsx @@ -14,6 +14,8 @@ import onPrMergePanelOpen from '../github-events/on-pr-merge-panel-open.js'; import {onPrMergePanelLoad} from '../github-events/on-fragment-load.js'; import onAbort from '../helpers/abort-controller.js'; import {userCanLikelyMergePR} from '../github-helpers/index.js'; +import {isHasSelectorSupported} from '../helpers/select-has.js'; +import {actionsTab, prCommitStatusIcon} from '../github-helpers/selectors.js'; // Reuse the same checkbox to preserve its status const generateCheckbox = onetime(() => ( @@ -43,7 +45,7 @@ function showCheckboxIfNecessary(): void { const isNecessary = lastCommitStatus === prCiStatus.PENDING // If the latest commit is missing an icon, add the checkbox as long as there's at least one CI icon on the page (including `ci-link`) - || (lastCommitStatus === false && select.exists(prCiStatus.commitStatusIconSelector)); + || (lastCommitStatus === false && select.exists(prCommitStatusIcon)); if (!checkbox && isNecessary) { select('.js-merge-form .select-menu')?.append(generateCheckbox()); @@ -181,10 +183,11 @@ function init(signal: AbortSignal): void { void features.add(import.meta.url, { asLongAs: [ + isHasSelectorSupported, userCanLikelyMergePR, pageDetect.isOpenPR, // The repo has enabled Actions - () => select.exists('#actions-tab'), + () => select.exists(actionsTab), ], include: [ pageDetect.isPRConversation, @@ -195,3 +198,12 @@ void features.add(import.meta.url, { awaitDomReady: true, // DOM-based inclusions init, }); + +/* + +Test URLs + +Checks: https://github.com/refined-github/sandbox/pull/12 +No Checks: https://github.com/refined-github/sandbox/pull/10 + +*/ |