Remove 'is true' when not neccessary
MODIFY
WalletWasabi.Gui/Behaviors/PasteAddressOnClickBehavior.cs
WalletWasabi.Gui/Behaviors/PasteAddressOnClickBehavior.cs
@@ -117,7 +117,7 @@ namespace WalletWasabi.Gui.Behaviors
Disposables.Add(
AssociatedObject.GetObservable(InputElement.PointerReleasedEvent).Subscribe(async pointer =>
{
- if (Global.UiConfig.Autocopy is false)
+ if (!Global.UiConfig.Autocopy)
{
return;
}
@@ -145,7 +145,7 @@ namespace WalletWasabi.Gui.Behaviors
Disposables.Add(
AssociatedObject.GetObservable(InputElement.PointerEnterEvent).Subscribe(async pointerEnter =>
{
- if (!(Global.UiConfig.Autocopy is true))
+ if (!(Global.UiConfig.Autocopy))
{
return;
}

MODIFY
WalletWasabi.Gui/Controls/MultiTextBox.cs
WalletWasabi.Gui/Controls/MultiTextBox.cs
@@ -193,7 +193,7 @@ namespace WalletWasabi.Gui.Controls
{
var eventArgs = eventPattern?.EventArgs as PointerPressedEventArgs;
var uiConfig = Locator.Current.GetService<Global>().UiConfig;
- if (uiConfig.Autocopy is true && eventArgs?.GetCurrentPoint(this).Properties.IsLeftButtonPressed == true)
+ if (uiConfig.Autocopy && eventArgs?.GetCurrentPoint(this).Properties.IsLeftButtonPressed is true)
{
if (CopyOnClick)
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -235,7 +235,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public bool IsWatchOnly => Wallet.KeyManager.IsWatchOnly;
public bool IsHardwareWallet => Wallet.KeyManager.IsHardwareWallet;
- public bool IsLurkingWifeMode => Global.UiConfig.LurkingWifeMode is true;
+ public bool IsLurkingWifeMode => Global.UiConfig.LurkingWifeMode;
public ReactiveCommand<Unit, Unit> EnqueueCommand { get; }

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -71,7 +71,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
this.WhenAnyValue(x => x.SelectedAddress)
.Subscribe(async address =>
{
- if (Global.UiConfig.Autocopy is false || address is null)
+ if (!Global.UiConfig.Autocopy || address is null)
{
return;
}

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendControlViewModel.cs
@@ -283,7 +283,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
var requests = new List<DestinationRequest>();
- if (Global.UiConfig.IsCustomChangeAddress is true && !IsMax && !string.IsNullOrWhiteSpace(CustomChangeAddress))
+ if (Global.UiConfig.IsCustomChangeAddress && !IsMax && !string.IsNullOrWhiteSpace(CustomChangeAddress))
{
try
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -60,13 +60,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
.DisposeWith(Disposables);
// If hardware wallet then we need the Send tab.
- if (Wallet.KeyManager.IsHardwareWallet is true)
+ if (Wallet.KeyManager.IsHardwareWallet)
{
SendTab = new SendTabViewModel(Wallet);
Actions.Add(SendTab);
}
// If not hardware wallet, but neither watch only then we also need the send tab.
- else if (Wallet.KeyManager.IsWatchOnly is false)
+ else if (!Wallet.KeyManager.IsWatchOnly)
{
SendTab = new SendTabViewModel(Wallet);
Actions.Add(SendTab);

MODIFY
WalletWasabi.Gui/Converters/LurkingWifeModeStringConverter.cs
WalletWasabi.Gui/Converters/LurkingWifeModeStringConverter.cs
@@ -15,7 +15,7 @@ namespace WalletWasabi.Gui.Converters
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var uiConfig = Locator.Current.GetService<Global>().UiConfig;
- if (uiConfig.LurkingWifeMode is true)
+ if (uiConfig.LurkingWifeMode)
{
int len = 10;
if (int.TryParse(parameter.ToString(), out int newLength))

MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -269,7 +269,7 @@ namespace WalletWasabi.Gui
}
else
{
- if (Config.UseTor is true)
+ if (Config.UseTor)
{
// onlyForOnionHosts: false - Connect to clearnet IPs through Tor, too.
connectionParameters.TemplateBehaviors.Add(new SocksSettingsBehavior(Config.TorSocks5EndPoint, onlyForOnionHosts: false, networkCredential: null, streamIsolation: true));
@@ -370,7 +370,7 @@ namespace WalletWasabi.Gui
// of course).
// On the other side, increasing this number forces users that do not need to discover more peers
// to spend resources (CPU/bandwidth) to discover new peers.
- needsToDiscoverPeers = Config.UseTor is true || AddressManager.Count < 500;
+ needsToDiscoverPeers = Config.UseTor || AddressManager.Count < 500;
Logger.LogInfo($"Loaded {nameof(AddressManager)} from `{AddressManagerFilePath}`.");
}
catch (DirectoryNotFoundException ex)
@@ -439,7 +439,7 @@ namespace WalletWasabi.Gui
{
try
{
- if (UiConfig.LurkingWifeMode is true)
+ if (UiConfig.LurkingWifeMode)
{
return;
}
@@ -477,7 +477,7 @@ namespace WalletWasabi.Gui
{
// In lurking wife mode no notification is raised.
// If there are no news, then don't bother too.
- if (UiConfig.LurkingWifeMode is true || !e.IsNews || (sender as Wallet).State != WalletState.Started)
+ if (UiConfig.LurkingWifeMode || !e.IsNews || (sender as Wallet).State != WalletState.Started)
{
return;
}

MODIFY
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
WalletWasabi.Gui/Tabs/SettingsViewModel.cs
@@ -45,9 +45,9 @@ namespace WalletWasabi.Gui.Tabs
{
Global = Locator.Current.GetService<Global>();
- Autocopy = Global.UiConfig.Autocopy is true;
- CustomFee = Global.UiConfig.IsCustomFee is true;
- CustomChangeAddress = Global.UiConfig.IsCustomChangeAddress is true;
+ Autocopy = Global.UiConfig.Autocopy;
+ CustomFee = Global.UiConfig.IsCustomFee;
+ CustomChangeAddress = Global.UiConfig.IsCustomChangeAddress;
var config = Config.LoadOrCreateDefaultFile(Global.Config.FilePath);
@@ -307,7 +307,7 @@ namespace WalletWasabi.Gui.Tabs
set => this.RaiseAndSetIfChanged(ref _dustThreshold, value);
}
- public bool LurkingWifeMode => Global.UiConfig.LurkingWifeMode is true;
+ public bool LurkingWifeMode => Global.UiConfig.LurkingWifeMode;
public string PinBoxText
{

MODIFY
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
@@ -153,7 +153,7 @@ namespace WalletWasabi.Gui.ViewModels
});
}
- public bool IsLurkingWifeMode => Global.UiConfig.LurkingWifeMode is true;
+ public bool IsLurkingWifeMode => Global.UiConfig.LurkingWifeMode;
public bool ClipboardNotificationVisible
{

Remove 'is true' when not neccessary