mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-24 06:48:38 +02:00
Cleanup and Bug fixes
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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!);
|
||||
|
||||
Reference in New Issue
Block a user