Merge pull request #252 from public-awesome/collection-actions-no-wallet-issue

Fix: Collection actions no wallet issue
This commit is contained in:
Serkan Reis 2023-10-17 09:28:44 +03:00 committed by GitHub
commit b41b927632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -66,7 +66,7 @@ export const JsonPreview = ({
</div>
{show && (
<div className="overflow-auto p-2 font-mono text-sm">
<pre>{JSON.stringify(content, null, 2).trim()}</pre>
<pre>{content ? JSON.stringify(content, null, 2).trim() : '{}'}</pre>
</div>
)}
</div>

View File

@ -337,8 +337,11 @@ export const CollectionActions = ({
const { isLoading, mutate } = useMutation(
async (event: FormEvent) => {
event.preventDefault()
if (!wallet.isWalletConnected) {
throw new Error('Please connect your wallet first.')
}
if (!type) {
throw new Error('Please select an action!')
throw new Error('Please select an action.')
}
if (minterContractAddress === '' && sg721ContractAddress === '') {
throw new Error('Please enter minter and sg721 contract addresses!')