Skip to content

Commit f94b6ff

Browse files
authored
isProject - Add support for organization projects (#208)
1 parent 0e65ffa commit f94b6ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ export const isOwnUserProfile = (): boolean => getCleanPathname() === getLoggedI
202202
// If there's a Report Abuse link, we're not part of the org
203203
export const isOwnOrganizationProfile = (): boolean => isOrganizationProfile() && !exists('[href*="contact/report-abuse?report="]');
204204

205-
export const isProject = (url: URL | HTMLAnchorElement | Location = location): boolean => /^projects\/\d+/.test(getRepo(url)?.path);
205+
export const isProject = (url: URL | HTMLAnchorElement | Location = location): boolean => /^projects\/\d+/.test(getRepo(url)?.path ?? getOrg(url)?.path);
206206
TEST: addTests('isProject', [
207207
'https://github.com/sindresorhus/refined-github/projects/3',
208+
'https://github.com/orgs/RSSNext/projects/3',
208209
]);
209210

210211
export const isProjects = (url: URL | HTMLAnchorElement | Location = location): boolean => getRepo(url)?.path === 'projects';

0 commit comments

Comments
 (0)