Skip to content

Commit

Permalink
Test updating isLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcramer committed Jun 11, 2024
1 parent e5bcfe6 commit 99e9a13
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion template/web/.env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=
NEXT_PRIVATE_RPC_URL="GET_FROM_COINBASE_DEVELOPER_PLATFORM" # See https://www.coinbase.com/developer-platform/products/base-node?utm_source=boat
NEXT_PRIVATE_PAYMASTER_URL="GET_FROM_COINBASE_DEVELOPER_PLATFORM" # See https://www.coinbase.com/developer-platform/products/base-node?utm_source=boat
NEXT_PUBLIC_PRIVY_ID="GET_FROM_PRIVY"
ENVIRONMENT=localhost
NEXT_PUBLIC_ENVIRONMENT=localhost
2 changes: 1 addition & 1 deletion template/web/.env.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=GA_TEST_1234567890
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=TEST_1234567890
NEXT_PRIVATE_RPC_URL=https://sepolia.base.org
ENVIRONMENT=localhost
NEXT_PUBLIC_ENVIRONMENT=localhost
NEXT_PUBLIC_PAYMASTER_URL=TEST_https://api.developer.coinbase.com/rpc/v1/
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import clsx from 'clsx';
import { useAccount } from 'wagmi';
import { useWriteContracts } from 'wagmi/experimental';
import { ContractAlertLayout } from 'app/buy-me-coffee/_components/ContractAlert';
import isLocal from '../../../src/utils/isLocal';
import { usePaymasterBundlerContract } from '../_contracts/usePaymasterBundlerContract';
import { CallStatus } from './CallStatus';

// Target the Paymaster directly without a proxy if running on localhost.
// Use the Paymaster Proxy when deployed.
const isLocalEnv = process.env.NEXT_PUBLIC_VERCEL_ENV === undefined;
const isLocalEnv = isLocal();
// const isLocalEnv = process.env.NEXT_PUBLIC_VERCEL_ENV === undefined;
console.log("isLocalEnv: ", isLocalEnv);
const defaultUrl = isLocalEnv
? process.env.NEXT_PUBLIC_PAYMASTER_URL
: `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}/api/paymaster-proxy`;
Expand Down
2 changes: 1 addition & 1 deletion template/web/src/store/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export enum Environment {
}

export enum EnvironmentKeys {
environment = 'ENVIRONMENT',
environment = 'NEXT_PUBLIC_ENVIRONMENT',
}

export function getCurrentEnvironment(): Environment {
Expand Down

0 comments on commit 99e9a13

Please sign in to comment.