summaryrefslogtreecommitdiff
path: root/source/features/releases-tab.tsx
diff options
context:
space:
mode:
authorGravatar yakov116 <16872793+yakov116@users.noreply.github.com> 2020-11-18 19:55:59 -0500
committerGravatar GitHub <noreply@github.com> 2020-11-18 18:55:59 -0600
commita935456acab0c7bdc021829e18ce20230e18c752 (patch)
treee61eed13a433381ba223a4ca962e904c8740fc91 /source/features/releases-tab.tsx
parentcab33f6f47c4eef0a3bc793f2004767f34b6abe9 (diff)
downloadrefined-github-20.11.19.tar.gz
refined-github-20.11.19.tar.zst
refined-github-20.11.19.zip
Lint (#3723)20.11.19
Diffstat (limited to 'source/features/releases-tab.tsx')
-rw-r--r--source/features/releases-tab.tsx10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/features/releases-tab.tsx b/source/features/releases-tab.tsx
index 855fbda6..b1e7812b 100644
--- a/source/features/releases-tab.tsx
+++ b/source/features/releases-tab.tsx
@@ -10,7 +10,7 @@ import * as api from '../github-helpers/api';
import looseParseInt from '../helpers/loose-parse-int';
import {appendBefore} from '../helpers/dom-utils';
import {createDropdownItem} from './more-dropdown';
-import {buildRepoURL, getRepoGQL, getRepo} from '../github-helpers';
+import {buildRepoURL, getRepo} from '../github-helpers';
const getCacheKey = (): string => `releases-count:${getRepo()!.nameWithOwner}`;
@@ -31,7 +31,7 @@ function parseCountFromDom(): number {
async function fetchFromApi(): Promise<number> {
const {repository} = await api.v4(`
- repository(${getRepoGQL()}) {
+ repository() {
refs(refPrefix: "refs/tags/") {
totalCount
}
@@ -136,11 +136,7 @@ async function init(): Promise<false | void> {
// Update "selected" tab mark
if (pageDetect.isReleasesOrTags()) {
- const selected = select('.reponav-item.selected');
- if (selected) {
- selected.classList.remove('js-selected-navigation-item', 'selected');
- }
-
+ select('.reponav-item.selected')?.classList.remove('js-selected-navigation-item', 'selected');
releasesTab.classList.add('js-selected-navigation-item', 'selected');
releasesTab.dataset.selectedLinks = 'repo_releases'; // Required for ajaxLoad
}