Skip to content

Commit 4c6b8fe

Browse files
committed
fix: use account hoot in my article page
1 parent 73242c2 commit 4c6b8fe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pages/articles-my.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import { ethers } from "ethers"
22
import { useEffect, useState } from "react"
33
import axios from "axios"
4+
import { useAccount } from "../hooks/useAccount"
45

56
import { nftmarketaddress, nftaddress } from "../config"
67

78
let ethAccount
89
export default function MyAssets() {
910
const [nfts, setNfts] = useState([])
1011
const [loadingState, setLoadingState] = useState("not-loaded")
11-
12-
if (typeof window !== "undefined") {
13-
ethAccount = localStorage.getItem("ethAccount")
14-
}
12+
const ethAccount = useAccount()
1513

1614
useEffect(() => {
1715
loadNFTs()

0 commit comments

Comments
 (0)