Skip to content

Commit 9ed3f6a

Browse files
jeronefregante
authored andcommitted
Enable discussion list features on new URLs (#2135)
1 parent 7e3cc5a commit 9ed3f6a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

source/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const isEnterprise = (): boolean => location.hostname !== 'github.com' &&
2323

2424
export const isGist = (): boolean => location.hostname.startsWith('gist.') || location.pathname.startsWith('gist/');
2525

26-
export const isGlobalDiscussionList = (): boolean => location.pathname === '/issues' || location.pathname === '/pulls';
26+
export const isGlobalDiscussionList = (): boolean => ['issues', 'pulls'].includes(location.pathname.split('/', 2)[1]);
2727

2828
export const isGlobalSearchResults = (): boolean => location.pathname === '/search' && new URLSearchParams(location.search).get('q') !== null;
2929

test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,14 @@ test('isRepoDiscussionList', urlMatcherMacro, pageDetect.isRepoDiscussionList, [
171171

172172
test('isGlobalDiscussionList', urlMatcherMacro, pageDetect.isGlobalDiscussionList, [
173173
'https://github.com/issues',
174+
'https://github.com/issues?q=is%3Apr+is%3Aopen',
175+
'https://github.com/issues/assigned',
176+
'https://github.com/issues/mentioned',
174177
'https://github.com/pulls',
175178
'https://github.com/pulls?q=issues',
176-
'https://github.com/issues?q=is%3Apr+is%3Aopen'
179+
'https://github.com/pulls/assigned',
180+
'https://github.com/pulls/mentioned',
181+
'https://github.com/pulls/review-requested'
177182
], [
178183
'https://github.com/issuesorter',
179184
'https://github.com/sindresorhus/refined-github/issues',

0 commit comments

Comments
 (0)