Skip to content

Commit

Permalink
Fix estimating fees nonstop spinning
Browse files Browse the repository at this point in the history
  • Loading branch information
broody committed Aug 11, 2024
1 parent d298701 commit 4ab68ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions packages/keychain/src/components/Execute/Fees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import { EthereumIcon } from "@cartridge/ui";

export function Fees({
fees,
balance,
approved,
}: {
fees?: { base: bigint; max: bigint };
balance: string;
approved?: string;
}) {
const chainId = useChainId();
Expand All @@ -21,7 +19,7 @@ export function Fees({
}>();

useEffect(() => {
if (!fees || !balance) {
if (!fees) {
return;
}
async function compute() {
Expand All @@ -38,7 +36,7 @@ export function Fees({
);
}
compute();
}, [chainId, fees, balance, approved]);
}, [chainId, fees, approved]);

return (
<VStack
Expand Down
4 changes: 2 additions & 2 deletions packages/keychain/src/components/Execute/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function Execute() {
return;
}

if (isDeployed && ctx.transactionsDetail?.maxFee) {
if (ctx.transactionsDetail?.maxFee) {
setFees({
base: BigInt(ctx.transactionsDetail.maxFee),
max: BigInt(ctx.transactionsDetail.maxFee),
Expand Down Expand Up @@ -177,7 +177,7 @@ export function Execute() {
/>
)
) : (
<Fees fees={fees} balance={ethBalance && format(ethBalance)} />
<Fees fees={fees} />
)}
<Button
colorScheme="colorful"
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/components/connect/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function Login(props: LoginProps) {
? "Play with Cartridge Controller"
: `Play ${theme.name}`
}
description="Enter your Controller username (yoyo)"
description="Enter your Controller username"
>
<Form {...props} />
</Container>
Expand Down

0 comments on commit 4ab68ca

Please sign in to comment.