mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 22:17:22 +01:00
do not publish notify from server on reconnect
This commit is contained in:
parent
fc3ad1f7f8
commit
f389bed4e1
3 changed files with 8 additions and 1 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors></Authors>
|
<Authors></Authors>
|
||||||
<Company></Company>
|
<Company></Company>
|
||||||
<Version>0.7.16</Version>
|
<Version>0.7.17</Version>
|
||||||
<Description></Description>
|
<Description></Description>
|
||||||
<Copyright></Copyright>
|
<Copyright></Copyright>
|
||||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||||
|
|
|
||||||
|
|
@ -261,6 +261,11 @@ public partial class ApiController
|
||||||
Mediator.Publish(new NotificationMessage("Warning from " + _serverManager.CurrentServer!.ServerName, message, NotificationType.Warning, 7500));
|
Mediator.Publish(new NotificationMessage("Warning from " + _serverManager.CurrentServer!.ServerName, message, NotificationType.Warning, 7500));
|
||||||
break;
|
break;
|
||||||
case MessageSeverity.Information:
|
case MessageSeverity.Information:
|
||||||
|
if (_doNotNotifiyOnNextInfo)
|
||||||
|
{
|
||||||
|
_doNotNotifiyOnNextInfo = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
Mediator.Publish(new NotificationMessage("Info from " + _serverManager.CurrentServer!.ServerName, message, NotificationType.Info, 5000));
|
Mediator.Publish(new NotificationMessage("Info from " + _serverManager.CurrentServer!.ServerName, message, NotificationType.Info, 5000));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ public partial class ApiController : MediatorSubscriberBase, IDisposable, IMareH
|
||||||
|
|
||||||
private CancellationTokenSource? _uploadCancellationTokenSource = new();
|
private CancellationTokenSource? _uploadCancellationTokenSource = new();
|
||||||
private CancellationTokenSource? _healthCheckTokenSource = new();
|
private CancellationTokenSource? _healthCheckTokenSource = new();
|
||||||
|
private bool _doNotNotifiyOnNextInfo = false;
|
||||||
|
|
||||||
private ConnectionDto? _connectionDto;
|
private ConnectionDto? _connectionDto;
|
||||||
public ServerInfo ServerInfo => _connectionDto?.ServerInfo ?? new ServerInfo();
|
public ServerInfo ServerInfo => _connectionDto?.ServerInfo ?? new ServerInfo();
|
||||||
|
|
@ -347,6 +348,7 @@ public partial class ApiController : MediatorSubscriberBase, IDisposable, IMareH
|
||||||
|
|
||||||
private Task MareHubOnReconnecting(Exception? arg)
|
private Task MareHubOnReconnecting(Exception? arg)
|
||||||
{
|
{
|
||||||
|
_doNotNotifiyOnNextInfo = true;
|
||||||
_healthCheckTokenSource?.Cancel();
|
_healthCheckTokenSource?.Cancel();
|
||||||
ServerState = ServerState.Reconnecting;
|
ServerState = ServerState.Reconnecting;
|
||||||
Mediator.Publish(new NotificationMessage("Connection lost", "Connection lost to " + _serverManager.CurrentServer!.ServerName, NotificationType.Warning, 5000));
|
Mediator.Publish(new NotificationMessage("Connection lost", "Connection lost to " + _serverManager.CurrentServer!.ServerName, NotificationType.Warning, 5000));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue