Skip to content

Commit

Permalink
Merge pull request #246 from CosmosContracts/upload-contract
Browse files Browse the repository at this point in the history
Add wallet check on contract upload
  • Loading branch information
findolor authored Aug 25, 2022
2 parents 18985fd + b7e805a commit 66f425e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pages/contracts/upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { useWallet } from 'contexts/wallet'
import type { NextPage } from 'next'
import { NextSeo } from 'next-seo'
import { useEffect, useRef, useState } from 'react'
import toast from 'react-hot-toast'
import { toast } from 'react-hot-toast'
import { FaAsterisk } from 'react-icons/fa'
import { withMetadata } from 'utils/layout'

const UploadContract: NextPage = () => {
const { getClient, address } = useWallet()
const { getClient, address, initialized } = useWallet()

const [loading, setLoading] = useState(false)
const [transactionResult, setTransactionResult] = useState<any>()
Expand Down Expand Up @@ -45,6 +45,7 @@ const UploadContract: NextPage = () => {

const upload = async () => {
try {
if (!initialized) return toast.error('Please connect your wallet.')
if (!wasmFile || !wasmByteArray) return toast.error('No file selected.')

setLoading(true)
Expand Down

0 comments on commit 66f425e

Please sign in to comment.