Skip to content

Commit faf5e37

Browse files
authored
fix: edit button should show in article page which is myself (#26)
1 parent 43cf8fb commit faf5e37

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

pages/article.js

+2-12
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ import { providers } from "ethers"
1717
import { init } from "@textile/eth-storage"
1818
import { useWeb3 } from "../hooks/useWeb3"
1919
import { Layout } from "../components/Layout"
20+
import { useAccount } from "../hooks/useAccount"
2021

21-
let ethAccount
22-
let myethAccount
2322
let cid
2423
let nft = {}
2524
export default function MyAssets() {
26-
// const [nft, setNft] = useState({})
25+
const myethAccount = useAccount()
2726
const provider = useWeb3()
2827
const [loadingState, setLoadingState] = useState("not-loaded")
2928
const router = useRouter()
@@ -117,15 +116,6 @@ export default function MyAssets() {
117116
await transaction.wait()
118117
}
119118

120-
if (typeof window !== "undefined") {
121-
myethAccount = localStorage.getItem("ethAccount")
122-
console.log("myethAccount", myethAccount)
123-
}
124-
125-
console.log(router.query)
126-
console.log(nft)
127-
console.log(loadingState != "loaded", !nft)
128-
129119
if (loadingState != "loaded" && !("name" in nft)) {
130120
loadNFT()
131121
}

0 commit comments

Comments
 (0)