Fix hang on QR code generation
MODIFY
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
WalletWasabi.Gui/ViewModels/AddressViewModel.cs
@@ -17,7 +17,6 @@ namespace WalletWasabi.Gui.ViewModels
private bool _isExpanded;
private bool[,] _qrCode;
- private bool[,] _qrCodeBacking;
private bool _clipboardNotificationVisible;
private double _clipboardNotificationOpacity;
@@ -37,11 +36,11 @@ namespace WalletWasabi.Gui.ViewModels
{
try
{
- if (x == true && QrCodeBacking is null)
+ if (x == true && QrCode is null)
{
var encoder = new QrEncoder();
encoder.TryEncode(Address, out var qrCode);
- QrCodeBacking = qrCode.Matrix.InternalArray;
+ Dispatcher.UIThread.PostLogException(() => QrCode = qrCode.Matrix.InternalArray);
}
}
catch (Exception ex)
@@ -50,10 +49,6 @@ namespace WalletWasabi.Gui.ViewModels
}
});
- this.WhenAnyValue(x => x.QrCodeBacking)
- .ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(x => QrCode = x);
-
Global.UiConfig.WhenAnyValue(x => x.LurkingWifeMode).Subscribe(_ =>
{
this.RaisePropertyChanged(nameof(Address));
@@ -93,12 +88,6 @@ namespace WalletWasabi.Gui.ViewModels
set => this.RaiseAndSetIfChanged(ref _qrCode, value);
}
- public bool[,] QrCodeBacking
- {
- get => _qrCodeBacking;
- set => this.RaiseAndSetIfChanged(ref _qrCodeBacking, value);
- }
-
public CancellationTokenSource CancelClipboardNotification { get; set; }
public async Task TryCopyToClipboardAsync()

Fix hang on QR code generation