File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -718,7 +718,7 @@ export const SwapController = {
718
718
const error = err as TransactionError ;
719
719
state . transactionError = error ?. shortMessage as unknown as string ;
720
720
state . loadingApprovalTransaction = false ;
721
- SnackController . showError ( error ?. shortMessage || 'Transaction error' ) ;
721
+ SnackController . showError ( error ?. shortMessage ?? 'Transaction error' ) ;
722
722
}
723
723
} ,
724
724
@@ -795,12 +795,12 @@ export const SwapController = {
795
795
const error = err as TransactionError ;
796
796
state . transactionError = error ?. shortMessage ;
797
797
state . loadingTransaction = false ;
798
- SnackController . showError ( error ?. shortMessage || 'Transaction error' ) ;
798
+ SnackController . showError ( error ?. shortMessage ?? 'Transaction error' ) ;
799
799
EventsController . sendEvent ( {
800
800
type : 'track' ,
801
801
event : 'SWAP_ERROR' ,
802
802
properties : {
803
- message : error ?. shortMessage || error ?. message || 'Unknown' ,
803
+ message : error ?. shortMessage ?? error ?. message ?? 'Unknown' ,
804
804
network : NetworkController . state . caipNetwork ?. id || '' ,
805
805
swapFromToken : this . state . sourceToken ?. symbol || '' ,
806
806
swapToToken : this . state . toToken ?. symbol || '' ,
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export const SwapCalculationUtil = {
63
63
} ,
64
64
65
65
isInsufficientNetworkTokenForGas ( networkBalanceInUSD : string , gasPriceInUSD : number | undefined ) {
66
- const gasPrice = gasPriceInUSD || '0' ;
66
+ const gasPrice = gasPriceInUSD ?? '0' ;
67
67
68
68
if ( NumberUtil . bigNumber ( networkBalanceInUSD ) . isZero ( ) ) {
69
69
return true ;
@@ -80,7 +80,7 @@ export const SwapCalculationUtil = {
80
80
const sourceTokenBalance = balance ?. find ( token => token . address === sourceTokenAddress )
81
81
?. quantity ?. numeric ;
82
82
83
- const isInSufficientBalance = NumberUtil . bigNumber ( sourceTokenBalance || '0' ) . isLessThan (
83
+ const isInSufficientBalance = NumberUtil . bigNumber ( sourceTokenBalance ?? '0' ) . isLessThan (
84
84
sourceTokenAmount
85
85
) ;
86
86
Original file line number Diff line number Diff line change @@ -654,7 +654,7 @@ export type Event =
654
654
655
655
// -- Send Controller Types -------------------------------------
656
656
export type EstimateGasTransactionArgs = {
657
- chainNamespace ?: undefined | 'eip155' ;
657
+ chainNamespace ?: 'eip155' ;
658
658
address : `0x${string } `;
659
659
to : `0x${string } `;
660
660
data : `0x${string } `;
You can’t perform that action at this time.
0 commit comments