mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
general-fixes (#2912)
* Handle tokens bottomsheet triggering on non-evm wallets * fix:Swith to the right fee currency when sending in bsc wallets
This commit is contained in:
@@ -275,22 +275,29 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
|
||||
paymentRequest: paymentRequest,
|
||||
fixedNetwork: fixedNetwork,
|
||||
onNext: (PaymentFlowResult newResult) {
|
||||
final selectedChainId = newResult.chainId;
|
||||
final isCompatible = selectedChainId == evm!.getSelectedChainId(sendViewModel.wallet);
|
||||
final canCheckCompatibility = evm != null &&
|
||||
isEVMCompatibleChain(sendViewModel.wallet.type) &&
|
||||
newResult.chainId != null;
|
||||
|
||||
if (isCompatible) {
|
||||
sendViewModel.setSelectedCryptoCurrency(
|
||||
newResult.addressDetectionResult!.detectedCurrency!.title,
|
||||
);
|
||||
_applyPaymentRequest(paymentRequest);
|
||||
} else {
|
||||
_showPaymentConfirmation(
|
||||
paymentViewModel,
|
||||
walletSwitcherViewModel,
|
||||
paymentRequest,
|
||||
newResult,
|
||||
);
|
||||
if (canCheckCompatibility) {
|
||||
final selectedChainId = newResult.chainId!;
|
||||
final isCompatible = selectedChainId == evm!.getSelectedChainId(sendViewModel.wallet);
|
||||
|
||||
if (isCompatible) {
|
||||
sendViewModel.setSelectedCryptoCurrency(
|
||||
newResult.addressDetectionResult!.detectedCurrency!.title,
|
||||
);
|
||||
_applyPaymentRequest(paymentRequest);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_showPaymentConfirmation(
|
||||
paymentViewModel,
|
||||
walletSwitcherViewModel,
|
||||
paymentRequest,
|
||||
newResult,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -163,7 +163,7 @@ class SwapConfirmationContentState extends State<SwapConfirmationContent> {
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
CakeImageWidget(
|
||||
imageUrl: detectedCurrency.iconPath!,
|
||||
imageUrl: detectedCurrency.iconPath ?? '',
|
||||
width: 32,
|
||||
height: 32,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user