From f4e097ccd4a3a6bdcb16be90e30d1aa5ff712afa Mon Sep 17 00:00:00 2001 From: naezith Date: Tue, 23 Jan 2024 14:57:00 +0300 Subject: [PATCH 1/2] fix some swap steps hanging forever --- lib/model/recent_swaps.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/model/recent_swaps.dart b/lib/model/recent_swaps.dart index ae7cb70ef..432920bcc 100644 --- a/lib/model/recent_swaps.dart +++ b/lib/model/recent_swaps.dart @@ -225,7 +225,7 @@ class SwapEEL { }); factory SwapEEL.fromJson(Map json) => SwapEEL( - data: json['data'] == null ? null : SwapEF.fromJson(json['data']), + data: json['data'] is Map ? SwapEF.fromJson(json['data']) : null, type: json['type'] ?? '', ); From ebeed21614147310642bb23b4d6ebec25266e012 Mon Sep 17 00:00:00 2001 From: naezith Date: Tue, 23 Jan 2024 15:23:29 +0300 Subject: [PATCH 2/2] fix MakerPaymentSpentByWatcher seen as fail step --- lib/blocs/swap_history_bloc.dart | 3 +++ lib/screens/dex/orders/swap/detailed_swap_steps.dart | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/blocs/swap_history_bloc.dart b/lib/blocs/swap_history_bloc.dart index 83c082669..e3d0c364e 100644 --- a/lib/blocs/swap_history_bloc.dart +++ b/lib/blocs/swap_history_bloc.dart @@ -49,6 +49,9 @@ class SwapHistoryBloc implements BlocBase { case 'MakerPaymentSpent': status = Status.SWAP_SUCCESSFUL; break; + case 'MakerPaymentSpentByWatcher': + status = Status.SWAP_SUCCESSFUL; + break; case 'TakerPaymentSpent': status = Status.SWAP_SUCCESSFUL; break; diff --git a/lib/screens/dex/orders/swap/detailed_swap_steps.dart b/lib/screens/dex/orders/swap/detailed_swap_steps.dart index 463b8a9e1..b4ef1e040 100644 --- a/lib/screens/dex/orders/swap/detailed_swap_steps.dart +++ b/lib/screens/dex/orders/swap/detailed_swap_steps.dart @@ -69,8 +69,8 @@ class _DetailedSwapStepsState extends State { if (index + 1 > swap.result.successEvents.length) { return SwapStepStatus.failed; } - if (swap.result.events[index].event.type == - swap.result.successEvents[index]) { + if (swap.result.successEvents + .any((String e) => e == swap.result.events[index].event.type)) { return SwapStepStatus.success; } else { return SwapStepStatus.failed;