File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -865,12 +865,15 @@ TEST: addTests('isRepositoryActions', [
865865
866866export const isUserTheOrganizationOwner = ( ) : boolean => isOrganizationProfile ( ) && exists ( '[aria-label="Organization"] [data-tab-item="org-header-settings-tab"]' ) ;
867867
868- export const canUserAdminRepo = ( ) : boolean => isRepo ( ) && exists ( [
869- '.GlobalNav a[href$="/settings"]' ,
870- // Remove after June 2026
871- '.reponav-item[href$="/settings"]' ,
872- '[data-tab-item$="settings-tab"]' ,
873- ] . join ( ',' ) ) ;
868+ export const canUserAdminRepo = ( ) : boolean => {
869+ const repo = getRepo ( ) ;
870+ return Boolean ( repo && exists ( [
871+ `.GlobalNav a[href="${ repo . nameWithOwner } /settings"]` ,
872+ // Remove after June 2026
873+ '.reponav-item[href$="/settings"]' ,
874+ '[data-tab-item$="settings-tab"]' ,
875+ ] . join ( ',' ) ) ) ;
876+ }
874877
875878export const isNewRepo = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => ! isGist ( url ) && ( url . pathname === '/new' || / ^ o r g a n i z a t i o n s \/ [ ^ / ] + \/ r e p o s i t o r i e s \/ n e w $ / . test ( getCleanPathname ( url ) ) ) ;
876879TEST: addTests ( 'isNewRepo' , [
You can’t perform that action at this time.
0 commit comments