Remove nullchecks on ui config
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 is true && eventArgs?.GetCurrentPoint(this).Properties.IsLeftButtonPressed == true)
{
if (CopyOnClick)
{

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 is false || 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 is true && !IsMax && !string.IsNullOrWhiteSpace(CustomChangeAddress))
{
try
{

MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -447,7 +447,7 @@ namespace WalletWasabi.Gui
{
try
{
- if (UiConfig?.LurkingWifeMode is true)
+ if (UiConfig.LurkingWifeMode is true)
{
return;
}
@@ -485,7 +485,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)
+ if (UiConfig.LurkingWifeMode is true || !e.IsNews)
{
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 is true;
+ CustomFee = Global.UiConfig.IsCustomFee is true;
+ CustomChangeAddress = Global.UiConfig.IsCustomChangeAddress is true;
var config = Config.LoadOrCreateDefaultFileAsync(Global.Config.FilePath);

Remove nullchecks on ui config