mb order status fixes

This commit is contained in:
julian 2023-03-03 11:56:21 -06:00
parent 54bc340c17
commit 58227c40be
4 changed files with 35 additions and 7 deletions

View file

@ -116,9 +116,16 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
} }
status = changeNowTransactionStatusFromStringIgnoreCase(statusString); status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
} on ArgumentError catch (_) { } on ArgumentError catch (_) {
status = ChangeNowTransactionStatus.Failed; switch (statusString.toLowerCase()) {
if (statusString == "Processing payment") { case "funds confirming":
status = ChangeNowTransactionStatus.Sending; case "processing payment":
return Assets.svg.txExchangePending(context);
case "completed":
return Assets.svg.txExchange(context);
default:
status = ChangeNowTransactionStatus.Failed;
} }
} }

View file

@ -290,11 +290,21 @@ class _DesktopTradeRowCardState extends ConsumerState<DesktopTradeRowCard> {
ChangeNowTransactionStatus? status; ChangeNowTransactionStatus? status;
try { try {
if (statusString.toLowerCase().startsWith("waiting")) { if (statusString.toLowerCase().startsWith("waiting")) {
statusString = "waiting"; statusString = "Waiting";
} }
status = changeNowTransactionStatusFromStringIgnoreCase(statusString); status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
} on ArgumentError catch (_) { } on ArgumentError catch (_) {
status = ChangeNowTransactionStatus.Failed; switch (statusString.toLowerCase()) {
case "funds confirming":
case "processing payment":
return Assets.svg.txExchangePending(context);
case "completed":
return Assets.svg.txExchange(context);
default:
status = ChangeNowTransactionStatus.Failed;
}
} }
switch (status) { switch (status) {

View file

@ -1603,6 +1603,7 @@ class StackColors extends ThemeExtension<StackColors> {
return const Color(0xFFD3A90F); return const Color(0xFFD3A90F);
case "Finished": case "Finished":
case "finished": case "finished":
case "Completed":
return accentColorGreen; return accentColorGreen;
case "Failed": case "Failed":
case "failed": case "failed":

View file

@ -25,11 +25,21 @@ class TradeCard extends ConsumerWidget {
ChangeNowTransactionStatus? status; ChangeNowTransactionStatus? status;
try { try {
if (statusString.toLowerCase().startsWith("waiting")) { if (statusString.toLowerCase().startsWith("waiting")) {
statusString = "waiting"; statusString = "Waiting";
} }
status = changeNowTransactionStatusFromStringIgnoreCase(statusString); status = changeNowTransactionStatusFromStringIgnoreCase(statusString);
} on ArgumentError catch (_) { } on ArgumentError catch (_) {
status = ChangeNowTransactionStatus.Failed; switch (statusString.toLowerCase()) {
case "funds confirming":
case "processing payment":
return Assets.svg.txExchangePending(context);
case "completed":
return Assets.svg.txExchange(context);
default:
status = ChangeNowTransactionStatus.Failed;
}
} }
switch (status) { switch (status) {