mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix tx status update (#3123)
* fix tx status update * fix infobox with disabled address rotation * check transaction direction (edge case)
This commit is contained in:
@@ -30,12 +30,11 @@ class HistorySection extends StatelessWidget {
|
||||
return SliverPadding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
sliver: Observer(
|
||||
builder: (_) => (dashboardViewModel.items.isEmpty &&
|
||||
dashboardViewModel.status is! SyncingSyncStatus)
|
||||
builder: (_) => (dashboardViewModel.items.isEmpty)
|
||||
? SliverPadding(
|
||||
padding: EdgeInsets.only(top: 24),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: Center(
|
||||
child: (dashboardViewModel.status is SyncingSyncStatus) ? SizedBox.shrink() : Center(
|
||||
child: Text(S.of(context).transactions_will_appear_here,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
|
||||
@@ -30,6 +30,8 @@ class ReceiveInfoBox extends StatelessWidget {
|
||||
onDismissed: onDismissed,
|
||||
);
|
||||
default:
|
||||
if(autoGenerateSubaddressStatus == AutoGenerateSubaddressStatus.disabled)
|
||||
return null;
|
||||
return ReceiveInfoBox(
|
||||
iconPath: "assets/new-ui/info.svg",
|
||||
message: S.current.infobox_auto_address,
|
||||
|
||||
@@ -490,6 +490,10 @@ abstract class DashboardViewModelBase with Store {
|
||||
))
|
||||
.where((item) => !transactions.contains(item));
|
||||
|
||||
transactions.removeWhere((item) =>
|
||||
newTransactions.any((tx) => tx.transaction.txHash == item.transaction.txHash && tx.transaction.direction == item.transaction.direction)
|
||||
);
|
||||
|
||||
transactions.addAll(newTransactions);
|
||||
// transactions.clear();
|
||||
// transactions.addAll(relevantTxs.map((tx) => TransactionListItem(
|
||||
|
||||
@@ -293,7 +293,10 @@ class TransactionListItem extends ActionListItem with Keyable {
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (other is TransactionListItem) {
|
||||
return other.transaction.txHash == transaction.txHash;
|
||||
return other.transaction.txHash == transaction.txHash &&
|
||||
other.transaction.confirmations == transaction.confirmations &&
|
||||
other.transaction.isPending == transaction.isPending &&
|
||||
other.transaction.direction == transaction.direction;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user