From c043250bc7ef3185643fe8f029a76c18e3ac60ec Mon Sep 17 00:00:00 2001 From: clincu-plenty Date: Thu, 29 Aug 2024 16:48:00 +0300 Subject: [PATCH 1/2] Download logo to right dir --- apps/web/build/fetchLogo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/build/fetchLogo.ts b/apps/web/build/fetchLogo.ts index 2d9b06e28..ee6b621c2 100644 --- a/apps/web/build/fetchLogo.ts +++ b/apps/web/build/fetchLogo.ts @@ -14,7 +14,7 @@ const fetchLogo = async (data: { [key: string]: Array }) => { console.log('Fetching logo from:', logoUrl.value); const fileType = logoUrl.value.split('.').pop(); - const logoPath = path.resolve(__dirname, `../public/logo.${fileType}`); + const logoPath = path.resolve(__dirname, `../public/images/logo.${fileType}`); fetchFile(logoUrl.value, logoPath); }; From c67234a409f2160fb2d23e83f6f88b3156e14a04 Mon Sep 17 00:00:00 2001 From: clincu-plenty Date: Thu, 29 Aug 2024 16:54:20 +0300 Subject: [PATCH 2/2] Fix undefined issue --- apps/web/build/fetchFavicon.ts | 2 +- apps/web/build/fetchLogo.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/build/fetchFavicon.ts b/apps/web/build/fetchFavicon.ts index 282ae2794..373fc5ae9 100644 --- a/apps/web/build/fetchFavicon.ts +++ b/apps/web/build/fetchFavicon.ts @@ -3,7 +3,7 @@ import fetchFile from './helpers/fetchFileHelper'; import { ConfigItem } from './types/ConfigItem'; const fetchFavicon = async (data: { [key: string]: Array }) => { - const faviconUrl = data['store'].find((setting: ConfigItem) => setting.key === 'favIcon'); + const faviconUrl = data['store']?.find((setting: ConfigItem) => setting.key === 'favIcon'); if (!faviconUrl?.value) { console.error('FavIcon URL not found.'); diff --git a/apps/web/build/fetchLogo.ts b/apps/web/build/fetchLogo.ts index ee6b621c2..57292fbc2 100644 --- a/apps/web/build/fetchLogo.ts +++ b/apps/web/build/fetchLogo.ts @@ -3,7 +3,7 @@ import fetchFile from './helpers/fetchFileHelper'; import { ConfigItem } from './types/ConfigItem'; const fetchLogo = async (data: { [key: string]: Array }) => { - const logoUrl = data['store'].find((setting: ConfigItem) => setting.key === 'logo'); + const logoUrl = data['store']?.find((setting: ConfigItem) => setting.key === 'logo'); if (!logoUrl?.value) { console.error('Logo URL not found.');