Skip to content

Commit

Permalink
feat(scroll): complete the mint NFT process
Browse files Browse the repository at this point in the history
  • Loading branch information
TwilightLogic authored and WGB5445 committed Nov 10, 2023
1 parent 239aef5 commit 7cffd93
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions pages/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,22 @@ export default function Scroll() {
})
const { chains, switchNetwork } = useSwitchNetwork()
const { openConnectModal } = useConnectModal()
React.useEffect(() => {
if (!isConnected && activeStep >= 1) {
openConnectModal()
}
console.log(chains[2])
console.log(chain.optimismGoerli)
// TODO: failed to change network
if (currectChain?.id != 534352) {
switchNetwork?.(chains[2].id)
}
}, [isConnected, activeStep])

// React.useEffect(() => {
// if (!isConnected && activeStep >= 1) {
// openConnectModal()
// }
// console.log(chains[2])
// console.log(chain.optimismGoerli)
// if (currectChain?.id != 534352) {
// switchNetwork?.(chains[2].id)
// }
// }, [isConnected, activeStep])

const handleNext = async () => {
if (activeStep === 0 && !isConnected) {
openConnectModal()
if (activeStep === 0) {
switchNetwork?.(chains[2].id)
setActiveStep((prevActiveStep) => prevActiveStep + 1)
} else if (activeStep == 1) {
// depoly
sendTransaction()
Expand Down

0 comments on commit 7cffd93

Please sign in to comment.