File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ TEST: addTests('isTeamDiscussion', [
196
196
'https://github.com/orgs/refined-github/teams/core-team' ,
197
197
] ) ;
198
198
199
- export const isOwnUserProfile = ( ) : boolean => getCleanPathname ( ) === getUsername ( ) ;
199
+ export const isOwnUserProfile = ( ) : boolean => getCleanPathname ( ) === getLoggedInUser ( ) ;
200
200
201
201
// If there's a Report Abuse link, we're not part of the org
202
202
export const isOwnOrganizationProfile = ( ) : boolean => isOrganizationProfile ( ) && ! exists ( '[href*="contact/report-abuse?report="]' ) ;
@@ -749,7 +749,7 @@ TEST: addTests('isNewRepoTemplate', [
749
749
] ) ;
750
750
751
751
/** Get the logged-in user’s username */
752
- const getUsername = ( ) : string | undefined => $ ( 'meta[name="user-login"]' ) ?. getAttribute ( 'content' ) ?? undefined ;
752
+ const getLoggedInUser = ( ) : string | undefined => $ ( 'meta[name="user-login"]' ) ?. getAttribute ( 'content' ) ?? undefined ;
753
753
754
754
/** Drop all duplicate slashes */
755
755
const getCleanPathname = ( url : URL | HTMLAnchorElement | Location = location ) : string => url . pathname . replaceAll ( / \/ + / g, '/' ) . slice ( 1 , url . pathname . endsWith ( '/' ) ? - 1 : undefined ) ;
@@ -825,7 +825,9 @@ const getRepo = (url?: URL | HTMLAnchorElement | Location | string): RepositoryI
825
825
826
826
export const utils = {
827
827
getOrg,
828
- getUsername,
828
+ /** @deprecated Use `getLoggedInUser` */
829
+ getUsername : getLoggedInUser ,
830
+ getLoggedInUser,
829
831
getCleanPathname,
830
832
getCleanGistPathname,
831
833
getRepositoryInfo : getRepo ,
You can’t perform that action at this time.
0 commit comments