From 8bb12374c89e676d8f0b0e5d640212c316caf0e1 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Thu, 11 Apr 2024 12:11:38 -0500 Subject: [PATCH 1/2] fix: button in read method --- .../app/debug/_components/contract/ReadOnlyFunctionForm.tsx | 6 +++--- packages/nextjs/scaffold.config.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx b/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx index 4aca5677..72e37f91 100644 --- a/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx +++ b/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx @@ -36,7 +36,7 @@ export const ReadOnlyFunctionForm = ({ ); const [result, setResult] = useState(); - const { isFetching, refetch } = useContractRead({ + const { isLoading, isFetching, refetch } = useContractRead({ address: contractAddress, functionName: abiFunction.name, abi: [...abi], @@ -85,9 +85,9 @@ export const ReadOnlyFunctionForm = ({ const { data } = await refetch(); setResult(data); }} - disabled={isFetching} + disabled={!isLoading && isFetching} > - {isFetching && ( + {(!isLoading && isFetching) && ( )} Read 📡 diff --git a/packages/nextjs/scaffold.config.ts b/packages/nextjs/scaffold.config.ts index 9d010910..b57feb3a 100644 --- a/packages/nextjs/scaffold.config.ts +++ b/packages/nextjs/scaffold.config.ts @@ -8,7 +8,7 @@ export type ScaffoldConfig = { }; const scaffoldConfig = { - targetNetworks: [chains.devnet], + targetNetworks: [chains.sepolia], // Only show the Burner Wallet when running on devnet onlyLocalBurnerWallet: false, rpcProviderUrl: process.env.NEXT_PUBLIC_PROVIDER_URL || "", From 8bfa21522f1c82654b31eaca4c5d00f91ff5fa8f Mon Sep 17 00:00:00 2001 From: Eduardo Date: Thu, 11 Apr 2024 12:14:28 -0500 Subject: [PATCH 2/2] fix: format --- .../app/debug/_components/contract/ReadOnlyFunctionForm.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx b/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx index 72e37f91..cc6d167e 100644 --- a/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx +++ b/packages/nextjs/app/debug/_components/contract/ReadOnlyFunctionForm.tsx @@ -1,7 +1,6 @@ "use client"; import { useState } from "react"; -import { InheritanceTooltip } from "./InheritanceTooltip"; import { Abi } from "abi-wan-kanabi"; import { Address } from "@starknet-react/chains"; import { @@ -12,7 +11,6 @@ import { getParsedContractFunctionArgs, transformAbiFunction, } from "~~/app/debug/_components/contract"; -import { notification } from "~~/utils/scaffold-stark"; import { AbiFunction } from "~~/utils/scaffold-stark/contract"; import { BlockNumber } from "starknet"; import { useContractRead } from "@starknet-react/core"; @@ -87,7 +85,7 @@ export const ReadOnlyFunctionForm = ({ }} disabled={!isLoading && isFetching} > - {(!isLoading && isFetching) && ( + {!isLoading && isFetching && ( )} Read 📡