From 368edf70b56670626b3fff934a7658197f257672 Mon Sep 17 00:00:00 2001 From: Sohal Kumar Singh <68388983+sohalkumar@users.noreply.github.com> Date: Tue, 27 Feb 2024 13:01:51 +0530 Subject: [PATCH] Fixed favicon requests for empty domain names (#4191) * Fixed favicon requests for empty domain names * Fixed the test case for undefined domain name --- packages/twenty-front/src/utils/__tests__/utils.test.ts | 4 +--- packages/twenty-front/src/utils/index.ts | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/twenty-front/src/utils/__tests__/utils.test.ts b/packages/twenty-front/src/utils/__tests__/utils.test.ts index 9fa996f49..a2b760318 100644 --- a/packages/twenty-front/src/utils/__tests__/utils.test.ts +++ b/packages/twenty-front/src/utils/__tests__/utils.test.ts @@ -42,8 +42,6 @@ describe('getLogoUrlFromDomainName', () => { }); test('should handle undefined input', () => { - expect(getLogoUrlFromDomainName(undefined)).toBe( - 'https://favicon.twenty.com/', - ); + expect(getLogoUrlFromDomainName(undefined)).toBe(undefined); }); }); diff --git a/packages/twenty-front/src/utils/index.ts b/packages/twenty-front/src/utils/index.ts index 2bb4bbd20..63042b0b5 100644 --- a/packages/twenty-front/src/utils/index.ts +++ b/packages/twenty-front/src/utils/index.ts @@ -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; };