summaryrefslogtreecommitdiff
path: root/source/github-helpers/pr-ci-status.ts
diff options
context:
space:
mode:
Diffstat (limited to 'source/github-helpers/pr-ci-status.ts')
-rw-r--r--source/github-helpers/pr-ci-status.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/github-helpers/pr-ci-status.ts b/source/github-helpers/pr-ci-status.ts
index d1c4a970..31e074fc 100644
--- a/source/github-helpers/pr-ci-status.ts
+++ b/source/github-helpers/pr-ci-status.ts
@@ -1,4 +1,4 @@
-import select from 'select-dom';
+import {$, lastElement} from 'select-dom';
import api from './api.js';
import {prCommit, prCommitStatusIcon} from './selectors.js';
@@ -9,13 +9,13 @@ export const PENDING = Symbol('Pending');
export type CommitStatus = false | typeof SUCCESS | typeof FAILURE | typeof PENDING;
export function getLastCommitReference(): string {
- return select.last(`${prCommit} code`)!.textContent;
+ return lastElement(`${prCommit} code`)!.textContent;
}
export function getLastCommitStatus(): CommitStatus {
// Select the last commit first, THEN pick the icon, otherwise it might pick non-last commit while the CI is starting up
- const lastCommit = select.last(prCommit)!;
- const lastCommitStatusIcon = select(prCommitStatusIcon, lastCommit);
+ const lastCommit = lastElement(prCommit)!;
+ const lastCommitStatusIcon = $(prCommitStatusIcon, lastCommit);
// Some commits don't have a CI status icon at all
if (lastCommitStatusIcon) {