Skip to content

Commit

Permalink
transfer dialog: allow chain switch when approving eth bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
sehyunc committed Nov 19, 2024
1 parent 5649f4c commit d95c8ca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/dialogs/transfer/default-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ export function DefaultForm({
!form.formState.isValid || (isDeposit && isMaxBalances)
}
size="xl"
type="submit"
variant="outline"
>
{buttonText}
Expand Down Expand Up @@ -645,6 +646,7 @@ export function DefaultForm({
!form.formState.isValid || (isDeposit && isMaxBalances)
}
size="xl"
type="submit"
variant="outline"
>
{buttonText}
Expand Down
3 changes: 3 additions & 0 deletions components/dialogs/transfer/usdc-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ export function USDCForm({
if (bridgeAllowanceRequired) {
await switchChainAndInvoke(mainnet.id, async () =>
handleApproveBridge({
chainId: mainnet.id,
address: USDC_L1_TOKEN.address,
args: [
bridgeQuote?.estimate.approvalAddress as `0x${string}`,
Expand Down Expand Up @@ -1212,6 +1213,7 @@ export function USDCForm({
className="flex-1 border-0 border-t font-extended text-2xl"
disabled={isSubmitDisabled}
size="xl"
type="submit"
variant="outline"
>
{buttonText}
Expand All @@ -1237,6 +1239,7 @@ export function USDCForm({
className="flex w-full flex-col items-center justify-center whitespace-normal text-pretty border-l-0 font-extended text-lg"
disabled={isSubmitDisabled}
size="xl"
type="submit"
variant="outline"
>
{buttonText}
Expand Down
2 changes: 2 additions & 0 deletions components/dialogs/transfer/weth-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ export function WETHForm({
!form.formState.isValid || (isDeposit && isMaxBalances)
}
size="xl"
type="submit"
variant="outline"
>
{buttonText}
Expand Down Expand Up @@ -951,6 +952,7 @@ export function WETHForm({
!form.formState.isValid || (isDeposit && isMaxBalances)
}
size="xl"
type="submit"
variant="outline"
>
{buttonText}
Expand Down
3 changes: 2 additions & 1 deletion providers/wagmi-provider/wagmi-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ function SyncRenegadeWagmiState() {
})
}

checkConnections()
// TODO: Disabled because it prevents switching to Mainnet when bridging
// checkConnections()
}, [chainId, connector, isConnected, wagmiConfig, disconnectWagmi])

// When switching accounts in a wallet, we need to ensure the new account
Expand Down

0 comments on commit d95c8ca

Please sign in to comment.