Skip to content

Commit

Permalink
fix(common): add fallback for missing env var and stub in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
przemyslaw-wlodek committed Jan 20, 2025
1 parent 2e97290 commit 3ed31ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('useFetchImage', () => {
return mockImage;
}
} as typeof Image;
process.env.BLOCKFROST_IPFS_URL = 'https://ipfs.blockfrost.dev';
});

afterEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/ui/hooks/useFetchImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type ImageFetchStateMap = {

export type UseFetchImageState = ImageFetchStateMap[ImageFetchStatus];

const BLOCKFROST_IPFS_URL = process.env.BLOCKFROST_IPFS_URL || '';
const BLOCKFROST_IPFS_URL = process.env.BLOCKFROST_IPFS_URL || ' ';

const maxConcurrentBlockfrostRequests = Number.parseInt(process.env.BLOCKFROST_IPFS_CONCURRENT_REQUESTS || '0', 10);
let concurrentBlockfrostRequestsCount = 0;
Expand Down

0 comments on commit 3ed31ad

Please sign in to comment.