Add mask when privacy mode is on for CJ balance
MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
@@ -4,6 +4,8 @@ using System.Reactive.Disposables;
using System.Reactive.Linq;
using Avalonia.Controls;
using ReactiveUI;
+using WalletWasabi.Fluent.Helpers;
+using WalletWasabi.Fluent.ViewModels;
namespace WalletWasabi.Fluent.Controls;
@@ -15,8 +17,6 @@ public enum ReplacementMode
public class PrivacyContentControl : ContentControl
{
- private const char PrivacyChar = '#';
-
private CompositeDisposable? _disposable;
public static readonly StyledProperty<bool> IsPrivacyContentVisibleProperty =
@@ -97,7 +97,7 @@ public class PrivacyContentControl : ContentControl
})
.DisposeWith(_disposable);
- PrivacyText = new string(Enumerable.Repeat(PrivacyChar, (int)NumberOfPrivacyChars).ToArray());
+ PrivacyText = TextHelpers.GetPrivacyMask((int)NumberOfPrivacyChars);
}
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)

MODIFY
WalletWasabi.Fluent/Helpers/TextHelpers.cs
WalletWasabi.Fluent/Helpers/TextHelpers.cs
@@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using NBitcoin;
+using WalletWasabi.Fluent.ViewModels;
namespace WalletWasabi.Fluent.Helpers;
@@ -80,4 +81,9 @@ public static class TextHelpers
}
public static string ParseLabel(this string text) => Regex.Replace(text, @"\s+", " ").Trim();
+
+ public static string GetPrivacyMask(int repeatCount)
+ {
+ return new string(UIConstants.PrivacyChar, repeatCount);
+ }
}

ADD
WalletWasabi.Fluent/ViewModels/UIConstants.cs
+namespace WalletWasabi.Fluent.ViewModels;
+
+public static class UIConstants
+{
+ public const char PrivacyChar = '#';
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/CoinJoinStateViewModel.cs
@@ -310,7 +310,7 @@ public partial class CoinJoinStateViewModel : ViewModelBase
var total = _wallet.Coins.TotalAmount();
ElapsedTime = "Balance to coinjoin:";
- RemainingTime = normalAmount.ToFormattedString() + " BTC";
+ RemainingTime = Services.UiConfig.PrivacyMode ? TextHelpers.GetPrivacyMask(4) : normalAmount.ToFormattedString() + " BTC";
var percentage = privateAmount.ToDecimal(MoneyUnit.BTC) / total.ToDecimal(MoneyUnit.BTC) * 100;

Add mask when privacy mode is on for CJ balance