mirror of
https://github.com/desktop/desktop
synced 2024-09-13 21:31:32 +00:00
Use exported isGHE
This commit is contained in:
parent
25020cfbdb
commit
e927688603
|
@ -1,5 +1,6 @@
|
|||
import { IAPIEmail, getDotComAPIEndpoint } from './api'
|
||||
import { Account } from '../models/account'
|
||||
import { isGHE } from './endpoint-capabilities'
|
||||
|
||||
/**
|
||||
* Lookup a suitable email address to display in the application, based on the
|
||||
|
@ -53,7 +54,7 @@ function isEmailPublic(email: IAPIEmail): boolean {
|
|||
*/
|
||||
function getStealthEmailHostForEndpoint(endpoint: string) {
|
||||
const { hostname } = new URL(endpoint)
|
||||
return endpoint === getDotComAPIEndpoint() || hostname.endsWith(`.ghe.com`)
|
||||
return endpoint === getDotComAPIEndpoint() || isGHE(endpoint)
|
||||
? 'users.noreply.github.com'
|
||||
: `users.noreply.${hostname}`
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ import { Octicon } from '../octicons'
|
|||
import { API, getDotComAPIEndpoint } from '../../lib/api'
|
||||
import { TooltippedContent } from './tooltipped-content'
|
||||
import { TooltipDirection } from './tooltip'
|
||||
import { supportsAvatarsAPI } from '../../lib/endpoint-capabilities'
|
||||
import { isGHE, supportsAvatarsAPI } from '../../lib/endpoint-capabilities'
|
||||
import { Account } from '../../models/account'
|
||||
import { offsetFrom } from '../../lib/offset-from'
|
||||
import { ExpiringOperationCache } from './expiring-operation-cache'
|
||||
|
@ -178,9 +178,6 @@ function getAvatarUrlCandidates(
|
|||
return candidates
|
||||
}
|
||||
|
||||
const isGHE = (endpoint: string) =>
|
||||
new URL(endpoint).hostname.endsWith('ghe.com')
|
||||
|
||||
/** A component for displaying a user avatar. */
|
||||
export class Avatar extends React.Component<IAvatarProps, IAvatarState> {
|
||||
public static getDerivedStateFromProps(
|
||||
|
|
Loading…
Reference in a new issue