detect if connection issue happened
MODIFY
WalletWasabi.Fluent/ViewModels/StatusBar/StatusBarViewModel.cs
WalletWasabi.Fluent/ViewModels/StatusBar/StatusBarViewModel.cs
@@ -25,6 +25,7 @@ namespace WalletWasabi.Fluent.ViewModels.StatusBar
[AutoNotify] private int _peers;
[AutoNotify] private bool _updateAvailable;
[AutoNotify] private bool _criticalUpdateAvailable;
+ [AutoNotify] private bool _isConnectionIssueDetected;
[AutoNotify] private string? _versionText;
public StatusBarViewModel()
@@ -42,10 +43,15 @@ namespace WalletWasabi.Fluent.ViewModels.StatusBar
x => x.Peers,
x => x.BitcoinCoreStatus,
x => x.UpdateAvailable,
- x => x.CriticalUpdateAvailable)
+ x => x.CriticalUpdateAvailable,
+ x => x.IsConnectionIssueDetected)
.Throttle(TimeSpan.FromMilliseconds(100))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(_ => SetStatusBarState());
+
+ this.WhenAnyValue(x => x.BackendStatus)
+ .Where(status => status == BackendStatus.Connected)
+ .Subscribe(_ => IsConnectionIssueDetected = false);
}
public ICommand UpdateCommand { get; }
@@ -62,6 +68,12 @@ namespace WalletWasabi.Fluent.ViewModels.StatusBar
private void SetStatusBarState()
{
+ if (IsConnectionIssueDetected)
+ {
+ CurrentState = StatusBarState.ConnectionIssueDetected;
+ return;
+ }
+
if (CriticalUpdateAvailable)
{
CurrentState = StatusBarState.CriticalUpdateAvailable;
@@ -106,6 +118,18 @@ namespace WalletWasabi.Fluent.ViewModels.StatusBar
.Subscribe(status => BackendStatus = status)
.DisposeWith(Disposables);
+ Observable.FromEventPattern<bool>(Services.Synchronizer, nameof(Services.Synchronizer.ResponseArrivedIsGenSocksServFail))
+ .Subscribe(_ =>
+ {
+ if (BackendStatus == BackendStatus.Connected) // TODO: the event invoke must be refactored in Synchronizer
+ {
+ return;
+ }
+
+ IsConnectionIssueDetected = true;
+ })
+ .DisposeWith(Disposables);
+
Peers = TorStatus == TorStatus.NotRunning ? 0 : nodes.Count;
Observable
.Merge(Observable.FromEventPattern(nodes, nameof(nodes.Added)).Select(_ => Unit.Default)

MODIFY
WalletWasabi.Fluent/Views/StatusBar/StatusBar.axaml
WalletWasabi.Fluent/Views/StatusBar/StatusBar.axaml
<StackPanel TextBlock.Foreground="{DynamicResource TextControlForeground}"
TextBlock.FontSize="14"
MaxWidth="160"
- ClipToBounds="False">
+ ClipToBounds="False"
+ Spacing="16">
+
+ <!-- Warning message TODO: use InfoMessage control-->
+ <DockPanel
+ IsVisible="{Binding CurrentState, Converter={x:Static converters:StatusBarStateVisibilityConverter.Instance}, ConverterParameter={x:Static models:StatusBarState.ConnectionIssueDetected}}">
+ <PathIcon Data="{StaticResource info_regular}"
+ DockPanel.Dock="Top"
+ HorizontalAlignment="Center"
+ Height="25"/>
+ <TextBlock DockPanel.Dock="Bottom" Text="Wasabi was unable to connect to the server." TextWrapping="Wrap"
+ TextAlignment="Center" />
+ </DockPanel>
<!-- Status -->
<StackPanel Spacing="16">
</MultiBinding>
</StackPanel.IsVisible>
- <Separator Margin="-12 16 -12 6" />
+ <Separator Margin="-12 0 -12 6" />
<c:StatusItem Icon="{StaticResource arrow_clockwise_regular}"
Title="Update available"

detect if connection issue happened