Skip to content

Commit 51f6b34

Browse files
apply fix to the old header
1 parent 1269e3d commit 51f6b34

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -867,13 +867,12 @@ export const isUserTheOrganizationOwner = (): boolean => isOrganizationProfile()
867867

868868
export const canUserAdminRepo = (): boolean => {
869869
const repo = getRepo();
870-
return Boolean(repo && exists([
871-
`.GlobalNav a[href="/${repo.nameWithOwner}/settings"]`,
870+
return Boolean(repo && exists(`:is(${[
871+
'.GlobalNav',
872872
// Remove after June 2026
873-
'.reponav-item[href$="/settings"]',
874-
'[data-tab-item$="settings-tab"]',
875-
].join(',')));
876-
}
873+
'.js-repo-nav',
874+
].join(',')}) a[href="/${repo.nameWithOwner}/settings"]`));
875+
};
877876

878877
export const isNewRepo = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && (url.pathname === '/new' || /^organizations\/[^/]+\/repositories\/new$/.test(getCleanPathname(url)));
879878
TEST: addTests('isNewRepo', [

0 commit comments

Comments
 (0)