Skip to content

Commit 39612d0

Browse files
committed
fix txv2 ui issues
1 parent d3e56b6 commit 39612d0

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_details_view.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,8 @@ class _TransactionV2DetailsViewState
10191019
maxHeight: 360,
10201020
child: EditNoteView(
10211021
txid:
1022+
_transaction
1023+
.slateId ??
10221024
_transaction.txid,
10231025
walletId: walletId,
10241026
),
@@ -1034,7 +1036,8 @@ class _TransactionV2DetailsViewState
10341036
).pushNamed(
10351037
EditNoteView.routeName,
10361038
arguments: Tuple2(
1037-
_transaction.txid,
1039+
_transaction.slateId ??
1040+
_transaction.txid,
10381041
walletId,
10391042
),
10401043
);
@@ -1069,12 +1072,8 @@ class _TransactionV2DetailsViewState
10691072
.watch(
10701073
pTransactionNote((
10711074
txid:
1072-
(coin is Epiccash ||
1073-
coin
1074-
is Mimblewimblecoin)
1075-
? _transaction.slateId
1076-
.toString()
1077-
: _transaction.txid,
1075+
_transaction.slateId ??
1076+
_transaction.txid,
10781077
walletId: walletId,
10791078
)),
10801079
)

lib/pages/wallet_view/transaction_views/tx_v2/transaction_v2_list_item.dart

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
44
import 'package:flutter_riverpod/flutter_riverpod.dart';
55
import 'package:tuple/tuple.dart';
66

7+
import '../../../../models/exchange/response_objects/trade.dart';
78
import '../../../../models/isar/models/blockchain_data/v2/transaction_v2.dart';
89
import '../../../../models/isar/models/isar_models.dart';
910
import '../../../../providers/global/trades_service_provider.dart';
@@ -38,12 +39,17 @@ class TxListItem extends ConsumerWidget {
3839
if (tx is TransactionV2) {
3940
final _tx = tx as TransactionV2;
4041

41-
final matchingTrades = ref
42-
.read(tradesServiceProvider)
43-
.trades
44-
.where((e) => e.payInTxid == _tx.txid || e.payOutTxid == _tx.txid);
42+
final Iterable<Trade> matchingTrades =
43+
_tx.type == TransactionType.outgoing && _tx.txid.isNotEmpty
44+
? ref
45+
.read(tradesServiceProvider)
46+
.trades
47+
.where(
48+
(e) => e.payInTxid == _tx.txid || e.payOutTxid == _tx.txid,
49+
)
50+
: [];
4551

46-
if (_tx.type == TransactionType.outgoing && matchingTrades.isNotEmpty) {
52+
if (matchingTrades.isNotEmpty) {
4753
final trade = matchingTrades.first;
4854
return Container(
4955
decoration: BoxDecoration(
@@ -54,10 +60,7 @@ class TxListItem extends ConsumerWidget {
5460
child: Column(
5561
mainAxisSize: MainAxisSize.min,
5662
children: [
57-
TransactionCardV2(
58-
key: UniqueKey(),
59-
transaction: _tx,
60-
),
63+
TransactionCardV2(key: UniqueKey(), transaction: _tx),
6164
TradeCard(
6265
key: Key(
6366
_tx.txid +
@@ -94,7 +97,8 @@ class TxListItem extends ConsumerWidget {
9497
Text(
9598
"Trade details",
9699
style: STextStyles.desktopH3(
97-
context),
100+
context,
101+
),
98102
),
99103
DesktopDialogCloseButton(
100104
onPressedOverride: Navigator.of(
@@ -111,8 +115,9 @@ class TxListItem extends ConsumerWidget {
111115
// TODO: [prio:med]
112116
// transactionIfSentFromStack: tx,
113117
transactionIfSentFromStack: null,
114-
walletName: ref
115-
.watch(pWalletName(_tx.walletId)),
118+
walletName: ref.watch(
119+
pWalletName(_tx.walletId),
120+
),
116121
walletId: _tx.walletId,
117122
),
118123
),
@@ -171,10 +176,7 @@ class TxListItem extends ConsumerWidget {
171176
borderRadius: radius,
172177
),
173178
child: Breathing(
174-
child: FusionTxGroupCard(
175-
key: UniqueKey(),
176-
group: group,
177-
),
179+
child: FusionTxGroupCard(key: UniqueKey(), group: group),
178180
),
179181
);
180182
}

0 commit comments

Comments
 (0)