Fixed favicon requests for empty domain names (#4191)
* Fixed favicon requests for empty domain names * Fixed the test case for undefined domain name
This commit is contained in:
committed by
GitHub
parent
8b39e53e49
commit
368edf70b5
@ -42,8 +42,6 @@ describe('getLogoUrlFromDomainName', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('should handle undefined input', () => {
|
test('should handle undefined input', () => {
|
||||||
expect(getLogoUrlFromDomainName(undefined)).toBe(
|
expect(getLogoUrlFromDomainName(undefined)).toBe(undefined);
|
||||||
'https://favicon.twenty.com/',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -20,5 +20,7 @@ export const getLogoUrlFromDomainName = (
|
|||||||
domainName?: string,
|
domainName?: string,
|
||||||
): string | undefined => {
|
): string | undefined => {
|
||||||
const sanitizedDomain = sanitizeURL(domainName);
|
const sanitizedDomain = sanitizeURL(domainName);
|
||||||
return `https://favicon.twenty.com/${sanitizedDomain}`;
|
return sanitizedDomain
|
||||||
|
? `https://favicon.twenty.com/${sanitizedDomain}`
|
||||||
|
: undefined;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user