Skip to content

Commit

Permalink
fix: useSwitchChain isLoading -> isPending
Browse files Browse the repository at this point in the history
  • Loading branch information
jaybuidl committed Oct 10, 2024
1 parent 3fbb460 commit 876f6ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions web-devtools/src/components/ConnectWallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { Button } from "@kleros/ui-components-library";
import { SUPPORTED_CHAINS, DEFAULT_CHAIN } from "consts/chains";

export const SwitchChainButton: React.FC<{ className?: string }> = ({ className }) => {
// TODO isLoading is not documented, but exists in the type, might have changed to isPending
const { switchChain, isLoading } = useSwitchChain();
const { switchChain, isPending } = useSwitchChain();
const [, setError] = useState<string | null>(null);
const handleSwitch = useCallback(() => {
if (!switchChain) {
Expand All @@ -25,8 +24,8 @@ export const SwitchChainButton: React.FC<{ className?: string }> = ({ className
return (
<Button
{...{ className }}
isLoading={isLoading}
disabled={isLoading}
isLoading={isPending}
disabled={isPending}
text={`Switch to ${SUPPORTED_CHAINS[DEFAULT_CHAIN].name}`}
onClick={handleSwitch}
/>
Expand Down

0 comments on commit 876f6ff

Please sign in to comment.