Selector/Selector.MAUI/Pages/Index.razor

24 lines
536 B
Plaintext
Raw Normal View History

@page "/app"
@using Selector.SignalR
@inject NowHubClient nowClient
@inject NowHubCache nowCache
@inject ILogger<Index> logger
2023-01-21 16:55:51 +00:00
2023-01-25 21:04:39 +00:00
<h1>run that</h1>
2023-01-21 16:55:51 +00:00
@code {
2023-01-21 16:55:51 +00:00
protected async override Task OnInitializedAsync()
{
if (nowClient.State == Microsoft.AspNetCore.SignalR.Client.HubConnectionState.Disconnected)
{
logger.LogInformation("Starting now hub connection");
await nowClient.StartAsync();
nowCache.BindClient();
await nowClient.OnConnected();
}
}
}