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
|
@override
|
||||||
Widget middle(BuildContext context) => Row(
|
Widget middle(BuildContext context) => Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -254,16 +259,17 @@ class ExchangePage extends BasePage {
|
||||||
|
|
||||||
if (_formKey.currentState != null &&
|
if (_formKey.currentState != null &&
|
||||||
_formKey.currentState!.validate()) {
|
_formKey.currentState!.validate()) {
|
||||||
if ((exchangeViewModel.depositCurrency == CryptoCurrency.xmr) &&
|
if (_shouldWaitTillSynced) {
|
||||||
(!(exchangeViewModel.status is SyncedSyncStatus))) {
|
|
||||||
showPopUp<void>(
|
showPopUp<void>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertWithOneAction(
|
return AlertWithOneAction(
|
||||||
alertTitle: S.of(context).exchange,
|
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,
|
buttonText: S.of(context).ok,
|
||||||
buttonAction: () => Navigator.of(context).pop());
|
buttonAction: () => Navigator.of(context).pop(),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
final check = exchangeViewModel.shouldDisplayTOTP();
|
final check = exchangeViewModel.shouldDisplayTOTP();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue