diff options
Diffstat (limited to 'source/features/add-tag-to-commits.tsx')
| -rw-r--r-- | source/features/add-tag-to-commits.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/features/add-tag-to-commits.tsx b/source/features/add-tag-to-commits.tsx index 05048c82..48d739b7 100644 --- a/source/features/add-tag-to-commits.tsx +++ b/source/features/add-tag-to-commits.tsx @@ -6,7 +6,7 @@ import * as pageDetect from 'github-url-detection'; import features from '.'; import * as api from '../github-helpers/api'; -import {getOwnerAndRepo, getRepoURL, getRepoGQL} from '../github-helpers'; +import {getRepoURL, getRepoGQL} from '../github-helpers'; interface CommitTags { [name: string]: string[]; @@ -32,9 +32,6 @@ interface TagNode { target: CommonTarget; } -const {ownerName, repoName} = getOwnerAndRepo(); -const cacheKey = `tags:${ownerName!}/${repoName!}`; - function mergeTags(oldTags: CommitTags, newTags: CommitTags): CommitTags { const result: CommitTags = {...oldTags}; for (const commit in newTags) { @@ -121,6 +118,8 @@ async function getTags(lastCommit: string, after?: string): Promise<CommitTags> } async function init(): Promise<void | false> { + const cacheKey = `tags:${getRepoURL()}`; + const commitsOnPage = select.all('li.commit'); const lastCommitOnPage = (commitsOnPage[commitsOnPage.length - 1].dataset.channel as string).split(':')[3]; let cached = await cache.get<{[commit: string]: string[]}>(cacheKey) ?? {}; |
