Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix swap steps hanging #99

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/blocs/swap_history_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/model/recent_swaps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class SwapEEL {
});

factory SwapEEL.fromJson(Map<String, dynamic> json) => SwapEEL(
data: json['data'] == null ? null : SwapEF.fromJson(json['data']),
data: json['data'] is Map ? SwapEF.fromJson(json['data']) : null,
type: json['type'] ?? '',
);

Expand Down
4 changes: 2 additions & 2 deletions lib/screens/dex/orders/swap/detailed_swap_steps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class _DetailedSwapStepsState extends State<DetailedSwapSteps> {
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;
Expand Down
Loading