Skip to content

Commit

Permalink
fix: Adding env var
Browse files Browse the repository at this point in the history
  • Loading branch information
paintoshi committed Oct 24, 2023
1 parent dd9385a commit 7ae89fe
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_WC_ID = ""
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Prerequisites:

Run development server:

Copy .env.sample to .env.local and add wallet connect project ID

```bash
yarn install
yarn dev
Expand Down
5 changes: 4 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ interface MyAppProps extends AppProps {
}

// 1. Get projectId
const projectId = '97235759ff6e7ec7545379f2a2046295'
const env = process.env
const projectId = env?.NEXT_PUBLIC_WC_ID || ''

console.info("WC", `${projectId?.slice(0, 4)}...`)

// 2. Create wagmiConfig
const metadata = {
Expand Down
6 changes: 3 additions & 3 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const Home: NextPage = () => {
setIsMinting(true)
try {
await writeAsync?.()
console.log("START", Date.now())
console.info("START", Date.now())
setStartTime(Date.now())
} catch (error: any) {
setIsMinting(false)
Expand All @@ -112,15 +112,15 @@ const Home: NextPage = () => {

useEffect(() => {
if (status === "error" && startTime > 0) {
console.log("ERROR", Date.now())
console.error("ERROR", Date.now())
setStartTime(0)
setCurrentTime(0)
}
}, [status, startTime])

useEffect(() => {
if ((isSuccess || isError) && startTime > 0 && isMinting) {
console.log(`Time taken ${Date.now() - startTime}ms`)
console.info(`Time taken ${Date.now() - startTime}ms`)
appendSpeed(chain?.name || "unknown", Date.now() - startTime)
}
if (isSuccess || isError) {
Expand Down

0 comments on commit 7ae89fe

Please sign in to comment.