mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-15 13:04:18 +01:00
do not publish twice on reconnect
This commit is contained in:
parent
b9ef6503d2
commit
f4f96380d9
1 changed files with 3 additions and 3 deletions
|
|
@ -265,10 +265,10 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ConnectionDto> GetConnectionDto()
|
public async Task<ConnectionDto> GetConnectionDto(bool publishConnected = true)
|
||||||
{
|
{
|
||||||
var dto = await _mareHub!.InvokeAsync<ConnectionDto>(nameof(GetConnectionDto)).ConfigureAwait(false);
|
var dto = await _mareHub!.InvokeAsync<ConnectionDto>(nameof(GetConnectionDto)).ConfigureAwait(false);
|
||||||
Mediator.Publish(new ConnectedMessage(dto));
|
if (publishConnected) Mediator.Publish(new ConnectedMessage(dto));
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -398,7 +398,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
InitializeApiHooks();
|
InitializeApiHooks();
|
||||||
_connectionDto = await GetConnectionDto().ConfigureAwait(false);
|
_connectionDto = await GetConnectionDto(publishConnected: false).ConfigureAwait(false);
|
||||||
if (_connectionDto.ServerVersion != IMareHub.ApiVersion)
|
if (_connectionDto.ServerVersion != IMareHub.ApiVersion)
|
||||||
{
|
{
|
||||||
await StopConnection(ServerState.VersionMisMatch).ConfigureAwait(false);
|
await StopConnection(ServerState.VersionMisMatch).ConfigureAwait(false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue