diff options
author | 2020-05-08 01:42:40 +0200 | |
---|---|---|
committer | 2020-05-08 01:42:40 +0200 | |
commit | a24d9460d36e5147f5a9f389923f2eb75f34e34f (patch) | |
tree | db2f1253ae14d3af1c842af66c318caa760401d4 /source/features/latest-tag-button.tsx | |
parent | 90b43ae76d84b53eb01a1d8961907c515c010994 (diff) | |
download | refined-github-a24d9460d36e5147f5a9f389923f2eb75f34e34f.tar.gz refined-github-a24d9460d36e5147f5a9f389923f2eb75f34e34f.tar.zst refined-github-a24d9460d36e5147f5a9f389923f2eb75f34e34f.zip |
Extract page-detect.ts into `github-url-detection` (#3062)
Diffstat (limited to 'source/features/latest-tag-button.tsx')
-rw-r--r-- | source/features/latest-tag-button.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/features/latest-tag-button.tsx b/source/features/latest-tag-button.tsx index 2e73d2a9..281e8d8c 100644 --- a/source/features/latest-tag-button.tsx +++ b/source/features/latest-tag-button.tsx @@ -4,11 +4,10 @@ import cache from 'webext-storage-cache'; import select from 'select-dom'; import TagIcon from 'octicon/tag.svg'; import elementReady from 'element-ready'; +import * as pageDetect from 'github-url-detection'; import * as api from '../libs/api'; import features from '../libs/features'; -import * as pageDetect from '../libs/page-detect'; import fetchDom from '../libs/fetch-dom'; -import {isRepoRoot} from '../libs/page-detect'; import getDefaultBranch from '../libs/get-default-branch'; import {getRepoURL, getCurrentBranch, replaceBranch, getRepoGQL, getLatestVersionTag} from '../libs/utils'; @@ -92,7 +91,7 @@ async function init(): Promise<false | void> { const currentBranch = getCurrentBranch(); let href: string; - if (isRepoRoot()) { + if (pageDetect.isRepoRoot()) { href = `/${getRepoURL()}/tree/${latestTag}`; } else { href = replaceBranch(currentBranch, latestTag); |