Cleanup and Bug fixes

This commit is contained in:
OmarHatem
2025-10-27 16:34:49 +01:00
parent 97c976d26c
commit 7b9cd9ec2b
7 changed files with 163 additions and 158 deletions
+1 -17
View File
@@ -629,7 +629,7 @@ class ExchangePage extends BasePage {
void _onCurrencyChange(CryptoCurrency currency, ExchangeViewModel exchangeViewModel,
GlobalKey<ExchangeCardState> key) {
final isCurrentTypeWallet = currency == exchangeViewModel.wallet.currency;
final isCurrentTypeWallet = exchangeViewModel.isDepositSameCurrency;
key.currentState!.changeSelectedCurrency(currency);
key.currentState!.changeWalletName(isCurrentTypeWallet ? exchangeViewModel.wallet.name : '');
@@ -708,22 +708,6 @@ class ExchangePage extends BasePage {
isMoneroWallet: exchangeViewModel.isMoneroWallet,
currencies: exchangeViewModel.depositCurrencies,
onCurrencySelected: (currency) {
// FIXME: need to move it into view model
if (currency == CryptoCurrency.xmr &&
exchangeViewModel.wallet.type != WalletType.monero) {
showPopUp<void>(
context: context,
builder: (dialogContext) {
return AlertWithOneAction(
alertTitle: S.of(context).error,
alertContent: S.of(context).exchange_incorrect_current_wallet_for_xmr,
buttonText: S.of(context).ok,
buttonAction: () => Navigator.of(dialogContext).pop(),
);
});
return;
}
exchangeViewModel.changeDepositCurrency(currency: currency);
},
currencyButtonColor: Colors.transparent,
+3 -1
View File
@@ -243,7 +243,9 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
PaymentRequest paymentRequest,
PaymentFlowResult result,
) async {
Navigator.of(context).pop();
if (context.mounted && Navigator.of(context).canPop()) {
Navigator.of(context).pop();
}
if (result.wallet != null) {
walletSwitcherViewModel.selectWallet(result.wallet!);