diff --git a/basePath.js b/basePath.js index d98754a6fb..0c4b1fb6f8 100644 --- a/basePath.js +++ b/basePath.js @@ -12,6 +12,6 @@ export function getPreviewBasePath() { /* This checks if the current domain is localhost and uses the localhost Infura key accordingly. */ -export function getInfuraAPIKey(key) { - return key; -} +// export function getInfuraAPIKey(key) { +// return window.location.hostname === 'localhost' ? import.meta.env.VITE_APP_INFURA_PROJECT_ID : key; +// } diff --git a/src/config/config-alpha.js b/src/config/config-alpha.js index 9087b34d17..e232138c5e 100644 --- a/src/config/config-alpha.js +++ b/src/config/config-alpha.js @@ -1,7 +1,11 @@ import { getInfuraAPIKey } from '../../basePath'; // environmental configurations for the dapp for different environments -const infuraAPIKey = getInfuraAPIKey('dd262cc008764b29bd6a15249db4772e'); +const infuraAPIKey = + window.location.hostname === 'localhost' + ? import.meta.env.VITE_APP_INFURA_PROJECT_ID + : 'dd262cc008764b29bd6a15249db4772e'; +// const infuraAPIKey = getInfuraAPIKey('dd262cc008764b29bd6a15249db4772e'); export const config = { /** * Push Nodes Environment - can be dev, staging or prod - important to keep one on one connection diff --git a/src/config/config-dev.js b/src/config/config-dev.js index ebfead3215..8451c4de23 100644 --- a/src/config/config-dev.js +++ b/src/config/config-dev.js @@ -1,7 +1,10 @@ import { getInfuraAPIKey } from '../../basePath'; // environmental configurations for the dapp for different environments -const infuraAPIKey = getInfuraAPIKey('be75cf427a5c41f9badb591994019d22'); +const infuraAPIKey = + window.location.hostname === 'localhost' + ? import.meta.env.VITE_APP_INFURA_PROJECT_ID + : 'be75cf427a5c41f9badb591994019d22'; export const config = { /** * Push Nodes Environment - can be dev, staging or prod - important to keep one on one connection diff --git a/src/config/config-prod.js b/src/config/config-prod.js index 1c75e7477e..e0e6803d8c 100644 --- a/src/config/config-prod.js +++ b/src/config/config-prod.js @@ -1,7 +1,11 @@ import { getInfuraAPIKey } from '../../basePath'; // environmental configurations for the dapp for different environments -const infuraAPIKey = getInfuraAPIKey('dd262cc008764b29bd6a15249db4772e'); +const infuraAPIKey = + window.location.hostname === 'localhost' + ? import.meta.env.VITE_APP_INFURA_PROJECT_ID + : 'dd262cc008764b29bd6a15249db4772e'; +// const infuraAPIKey = getInfuraAPIKey('dd262cc008764b29bd6a15249db4772e'); export const config = { /** * Push Nodes Environment - can be dev, staging or prod - important to keep one on one connection diff --git a/src/config/config-staging.js b/src/config/config-staging.js index d7e9d1bbc3..4f9a610633 100644 --- a/src/config/config-staging.js +++ b/src/config/config-staging.js @@ -1,7 +1,11 @@ import { getInfuraAPIKey } from '../../basePath'; // environmental configurations for the dapp for different environments -const infuraAPIKey = getInfuraAPIKey('be75cf427a5c41f9badb591994019d22'); +const infuraAPIKey = + window.location.hostname === 'localhost' + ? import.meta.env.VITE_APP_INFURA_PROJECT_ID + : 'be75cf427a5c41f9badb591994019d22'; +// const infuraAPIKey = getInfuraAPIKey('be75cf427a5c41f9badb591994019d22'); export const config = { /** * Push Nodes Environment - can be dev, staging or prod - important to keep one on one connection