Skip to content

Commit cf5a3e2

Browse files
yakov116fregante
andauthored
Add support for new organization repo to isNewRepo (#56)
Co-authored-by: Federico <me@fregante.com>
1 parent 8bfb033 commit cf5a3e2

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
@@ -489,9 +489,10 @@ export const canUserEditOrganization = (): boolean => isOrganizationProfile() &&
489489

490490
export const canUserEditRepo = (): boolean => isRepo() && exists('.reponav-item[href$="/settings"], [data-tab-item$="settings-tab"]');
491491

492-
export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/new';
492+
export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => url.pathname === '/new' || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url));
493493
collect.set('isNewRepo', [
494494
'https://github.com/new',
495+
'https://github.com/organizations/npmhub/repositories/new',
495496
]);
496497

497498
/** Get the logged-in user’s username */

0 commit comments

Comments
 (0)