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:
Sohal Kumar Singh 2024-02-27 13:01:51 +05:30 committed by GitHub
parent 8b39e53e49
commit 368edf70b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -42,8 +42,6 @@ describe('getLogoUrlFromDomainName', () => {
});
test('should handle undefined input', () => {
expect(getLogoUrlFromDomainName(undefined)).toBe(
'https://favicon.twenty.com/',
);
expect(getLogoUrlFromDomainName(undefined)).toBe(undefined);
});
});

View File

@ -20,5 +20,7 @@ export const getLogoUrlFromDomainName = (
domainName?: string,
): string | undefined => {
const sanitizedDomain = sanitizeURL(domainName);
return `https://favicon.twenty.com/${sanitizedDomain}`;
return sanitizedDomain
? `https://favicon.twenty.com/${sanitizedDomain}`
: undefined;
};