more robust fix
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinHistoryItemViewModel.cs
@@ -29,14 +29,7 @@ public class CoinJoinHistoryItemViewModel : HistoryItemViewModelBase
ConfirmedToolTip = $"{confirmations} confirmation{TextHelpers.AddSIfPlural(confirmations)}";
var amount = transactionSummary.Amount;
- if (amount < Money.Zero)
- {
- OutgoingAmount = amount * -1;
- }
- else
- {
- IncomingAmount = amount;
- }
+ SetAmount(amount);
ShowDetailsCommand = ReactiveCommand.Create(() =>
RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/CoinJoinsHistoryItemViewModel.cs
@@ -86,14 +86,7 @@ public class CoinJoinsHistoryItemViewModel : HistoryItemViewModelBase
{
IsConfirmed = CoinJoinTransactions.All(x => x.IsConfirmed());
Date = CoinJoinTransactions.Select(tx => tx.DateTime).Max().ToLocalTime();
- OutgoingAmount = CoinJoinTransactions.Sum(x => x.Amount) * -1;
-
- // OutgoingAmount/IncomingAmount should never be negative. In case of negative OutgoingAmount we gained money, for example: coordinator wallet in CJs.
- if (OutgoingAmount < Money.Zero)
- {
- IncomingAmount = CoinJoinTransactions.Sum(x => x.Amount);
- OutgoingAmount = null;
- }
+ SetAmount(CoinJoinTransactions.Sum(x => x.Amount));
UpdateDateString();
}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/HistoryItemViewModelBase.cs
@@ -75,6 +75,18 @@ public abstract partial class HistoryItemViewModelBase : ViewModelBase
throw new NotSupportedException();
}
+ protected virtual void SetAmount(Money amount)
+ {
+ if (amount < Money.Zero)
+ {
+ OutgoingAmount = amount * -1;
+ }
+ else
+ {
+ IncomingAmount = amount;
+ }
+ }
+
public virtual bool HasChildren() => false;
public static Comparison<HistoryItemViewModelBase?> SortAscending<T>(Func<HistoryItemViewModelBase, T> selector)

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/TransactionHistoryItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryItems/TransactionHistoryItemViewModel.cs
@@ -27,14 +27,7 @@ public class TransactionHistoryItemViewModel : HistoryItemViewModelBase
ConfirmedToolTip = $"{confirmations} confirmation{TextHelpers.AddSIfPlural(confirmations)}";
var amount = transactionSummary.Amount;
- if (amount < Money.Zero)
- {
- OutgoingAmount = amount * -1;
- }
- else
- {
- IncomingAmount = amount;
- }
+ SetAmount(amount);
ShowDetailsCommand = ReactiveCommand.Create(() =>
RoutableViewModel.Navigate(NavigationTarget.DialogScreen).To(

more robust fix