@@ -21,7 +21,6 @@ import {
21
21
} from "../../../../components/Drawer.js" ;
22
22
import { Spacer } from "../../../../components/Spacer.js" ;
23
23
import { Spinner } from "../../../../components/Spinner.js" ;
24
- import { SwitchNetworkButton } from "../../../../components/SwitchNetwork.js" ;
25
24
import { Container } from "../../../../components/basic.js" ;
26
25
import { Button } from "../../../../components/buttons.js" ;
27
26
import { Text } from "../../../../components/text.js" ;
@@ -171,8 +170,6 @@ export function SwapScreenContent(props: {
171
170
( swapRequired && ! quoteQuery . data ) ||
172
171
isNotEnoughBalance ||
173
172
allowanceQuery . isLoading ;
174
- const switchChainRequired =
175
- props . payer . wallet . getChain ( ) ?. id !== fromChain ?. id ;
176
173
177
174
const errorMsg =
178
175
! quoteQuery . isLoading && quoteQuery . error
@@ -319,19 +316,6 @@ export function SwapScreenContent(props: {
319
316
>
320
317
Pay with another token
321
318
</ Button >
322
- ) : switchChainRequired &&
323
- fromChain &&
324
- ! quoteQuery . isLoading &&
325
- ! allowanceQuery . isLoading &&
326
- ! isNotEnoughBalance &&
327
- ! quoteQuery . error ? (
328
- < SwitchNetworkButton
329
- variant = "accent"
330
- fullWidth
331
- switchChain = { async ( ) => {
332
- await props . payer . wallet . switchChain ( fromChain ) ;
333
- } }
334
- />
335
319
) : (
336
320
< Button
337
321
variant = { disableContinue ? "outline" : "accent" }
@@ -340,6 +324,9 @@ export function SwapScreenContent(props: {
340
324
disabled = { disableContinue }
341
325
onClick = { async ( ) => {
342
326
if ( ! disableContinue ) {
327
+ if ( props . payer . wallet . getChain ( ) ?. id !== fromChain ?. id ) {
328
+ await props . payer . wallet . switchChain ( fromChain ) ;
329
+ }
343
330
showSwapFlow ( ) ;
344
331
trackPayEvent ( {
345
332
event : "confirm_swap_quote" ,
0 commit comments