store the coinjoin filter value in the UiConfig
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/History/HistoryViewModel.cs
@@ -6,7 +6,9 @@ using System.Threading.Tasks;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
+using SharpDX.Direct2D1;
using WalletWasabi.Blockchain.Transactions;
+using WalletWasabi.Gui;
using WalletWasabi.Logging;
using WalletWasabi.Stores;
using WalletWasabi.Wallets;
@@ -22,10 +24,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
[AutoNotify] private bool _showCoinJoin;
- public HistoryViewModel(Wallet wallet)
+ public HistoryViewModel(Wallet wallet, UiConfig uiConfig)
{
_wallet = wallet;
_bitcoinStore = wallet.BitcoinStore;
+ _showCoinJoin = uiConfig.ShowCoinJoinInHistory;
_transactionSourceList = new SourceList<HistoryItemViewModel>();
var coinJoinFilter = this.WhenAnyValue(x => x.ShowCoinJoin).Select(CoinJoinFilter);
@@ -37,6 +40,10 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.History
.Sort(SortExpressionComparer<HistoryItemViewModel>.Descending(x => x.Date))
.Bind(out _transactions)
.Subscribe();
+
+ this.WhenAnyValue(x => x.ShowCoinJoin)
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(showCoinJoin => uiConfig.ShowCoinJoinInHistory = showCoinJoin);
}
public ReadOnlyObservableCollection<HistoryItemViewModel> Transactions => _transactions;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -44,7 +44,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
})
.DisposeWith(Disposables);
- History = new HistoryViewModel(wallet);
+ History = new HistoryViewModel(wallet, uiConfig);
}
private CompositeDisposable Disposables { get; set; }

MODIFY
WalletWasabi.Gui/UiConfig.cs
WalletWasabi.Gui/UiConfig.cs
@@ -21,6 +21,7 @@ namespace WalletWasabi.Gui
private bool _autocopy;
private int _feeDisplayFormat;
private bool _darkModeEnabled;
+ private bool _showCoinJoinInHistory;
public UiConfig() : base()
{
@@ -34,7 +35,8 @@ namespace WalletWasabi.Gui
x => x.IsCustomFee,
x => x.IsCustomChangeAddress,
x => x.DarkModeEnabled,
- x => x.FeeDisplayFormat)
+ x => x.FeeDisplayFormat,
+ x => x.ShowCoinJoinInHistory)
.Throttle(TimeSpan.FromMilliseconds(500))
.Skip(1) // Won't save on UiConfig creation.
.ObserveOn(RxApp.TaskpoolScheduler)
@@ -117,6 +119,14 @@ namespace WalletWasabi.Gui
set => RaiseAndSetIfChanged(ref _darkModeEnabled, value);
}
+ [DefaultValue(false)]
+ [JsonProperty(PropertyName = "ShowCoinJoinInHistory", DefaultValueHandling = DefaultValueHandling.Populate)]
+ public bool ShowCoinJoinInHistory
+ {
+ get => _showCoinJoinInHistory;
+ set => RaiseAndSetIfChanged(ref _showCoinJoinInHistory, value);
+ }
+
[JsonProperty(PropertyName = "CoinListViewSortingPreference")]
[JsonConverter(typeof(SortingPreferenceJsonConverter))]
public SortingPreference CoinListViewSortingPreference { get; internal set; } = new SortingPreference(SortOrder.Increasing, "Amount");

store the coinjoin filter value in the UiConfig