mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
disable swap until synced for btc/ltc/xmr
This commit is contained in:
parent
1e5568fc1b
commit
dcaeac9b85
1 changed files with 20 additions and 14 deletions
|
@ -97,6 +97,11 @@ class ExchangePage extends BasePage {
|
|||
}
|
||||
};
|
||||
|
||||
bool get _shouldWaitTillSynced =>
|
||||
[CryptoCurrency.xmr, CryptoCurrency.btc, CryptoCurrency.ltc]
|
||||
.contains(exchangeViewModel.depositCurrency) &&
|
||||
!(exchangeViewModel.status is SyncedSyncStatus);
|
||||
|
||||
@override
|
||||
Widget middle(BuildContext context) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
|
@ -254,16 +259,17 @@ class ExchangePage extends BasePage {
|
|||
|
||||
if (_formKey.currentState != null &&
|
||||
_formKey.currentState!.validate()) {
|
||||
if ((exchangeViewModel.depositCurrency == CryptoCurrency.xmr) &&
|
||||
(!(exchangeViewModel.status is SyncedSyncStatus))) {
|
||||
if (_shouldWaitTillSynced) {
|
||||
showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertWithOneAction(
|
||||
alertTitle: S.of(context).exchange,
|
||||
alertContent: S.of(context).exchange_sync_alert_content,
|
||||
alertContent:
|
||||
S.of(context).exchange_sync_alert_content,
|
||||
buttonText: S.of(context).ok,
|
||||
buttonAction: () => Navigator.of(context).pop());
|
||||
buttonAction: () => Navigator.of(context).pop(),
|
||||
);
|
||||
});
|
||||
} else {
|
||||
final check = exchangeViewModel.shouldDisplayTOTP();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue