Fix status stuck issue
MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -2,6 +2,7 @@ using Avalonia.Threading;
using AvalonStudio.Extensibility;
using AvalonStudio.Shell;
using NBitcoin.Protocol;
+using Nito.AsyncEx;
using ReactiveUI;
using System;
using System.Collections.Generic;
@@ -33,6 +34,7 @@ namespace WalletWasabi.Gui.ViewModels
public class StatusBarViewModel : ViewModelBase
{
private CompositeDisposable Disposables { get; } = new CompositeDisposable();
+ private AsyncLock StatusTextAnimationLock { get; }
private NodesCollection Nodes { get; }
private WasabiSynchronizer Synchronizer { get; }
@@ -58,6 +60,7 @@ namespace WalletWasabi.Gui.ViewModels
BlocksLeft = 0;
FiltersLeft = synchronizer.GetFiltersLeft();
UseTor = Global.Config.UseTor.Value; // Don't make it dynamic, because if you change this config settings only next time will it activate.
+ StatusTextAnimationLock = new AsyncLock();
Observable.FromEventPattern<NodeEventArgs>(nodes, nameof(nodes.Added))
.Subscribe(x =>
@@ -147,6 +150,8 @@ namespace WalletWasabi.Gui.ViewModels
});
this.WhenAnyValue(x => x.StatusText).Subscribe(async status =>
+ {
+ using (await StatusTextAnimationLock.LockAsync()) // Without this lock the status get stuck once in a while.
{
if (status.EndsWith(".")) // Then do animation.
{
@@ -169,6 +174,7 @@ namespace WalletWasabi.Gui.ViewModels
}
}
}
+ }
});
UpdateCommand = ReactiveCommand.Create(() =>

Fix status stuck issue