summaryrefslogtreecommitdiff
path: root/source/github-helpers/get-current-git-ref.ts
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2023-11-01 12:24:19 +0800
committerGravatar GitHub <noreply@github.com> 2023-11-01 04:24:19 +0000
commitae6ca57b45b4e4ad201793b8dc7f3535c43de976 (patch)
tree679608ff74b842731d0a1ce8591d2c17dd727010 /source/github-helpers/get-current-git-ref.ts
parent4a9e021202ceb76962d08d70ecab2ec9becab8d9 (diff)
downloadrefined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.tar.gz
refined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.tar.zst
refined-github-ae6ca57b45b4e4ad201793b8dc7f3535c43de976.zip
Meta: Use new `select-dom` API (#6992)
Diffstat (limited to 'source/github-helpers/get-current-git-ref.ts')
-rw-r--r--source/github-helpers/get-current-git-ref.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/github-helpers/get-current-git-ref.ts b/source/github-helpers/get-current-git-ref.ts
index b2d1d1c9..65b9feff 100644
--- a/source/github-helpers/get-current-git-ref.ts
+++ b/source/github-helpers/get-current-git-ref.ts
@@ -1,5 +1,5 @@
import {isRepoCommitList} from 'github-url-detection';
-import select from 'select-dom';
+import {$} from 'select-dom';
import {extractCurrentBranchFromBranchPicker} from './index.js';
import {branchSelector} from './selectors.js';
@@ -11,7 +11,7 @@ const titleWithGitRef = / at (?<branch>[.\w-/]+)( ยท [\w-]+\/[\w-]+)?$/i;
export default function getCurrentGitRef(): string | undefined {
// Note: This is not in the <head> so it's only available on AJAXed loads.
// It appears on every Code page except `commits` on folders/files
- const picker = select(branchSelector);
+ const picker = $(branchSelector);
const refViaPicker = picker && extractCurrentBranchFromBranchPicker(picker);
if (refViaPicker) {
return refViaPicker;
@@ -49,7 +49,7 @@ export function getGitRef(pathname: string, title: string): string | undefined {
// In <head>, but not reliable https://github.com/refined-github/refined-github/assets/1402241/50357d94-505f-48dc-bd54-74e86b19d642
function getCurrentBranchFromFeed(): string | undefined {
- const feedLink = isRepoCommitList() && select('link[type="application/atom+xml"]');
+ const feedLink = isRepoCommitList() && $('link[type="application/atom+xml"]');
if (!feedLink) {
// Do not throw errors, the element may be missing after AJAX navigation even if on the right page
return;