Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: download logo to right path / fix undefined error #634

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/build/fetchFavicon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fetchFile from './helpers/fetchFileHelper';
import { ConfigItem } from './types/ConfigItem';

const fetchFavicon = async (data: { [key: string]: Array<ConfigItem> }) => {
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.');
Expand Down
4 changes: 2 additions & 2 deletions apps/web/build/fetchLogo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fetchFile from './helpers/fetchFileHelper';
import { ConfigItem } from './types/ConfigItem';

const fetchLogo = async (data: { [key: string]: Array<ConfigItem> }) => {
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.');
Expand All @@ -14,7 +14,7 @@ const fetchLogo = async (data: { [key: string]: Array<ConfigItem> }) => {
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);
};
Expand Down
Loading