23 lines
No EOL
695 B
Text
23 lines
No EOL
695 B
Text
@using LANCommander.SDK.Services
|
|
@inject IConnectionClient ConnectionClient
|
|
|
|
@if (ConnectionClient.IsConnected() || ConnectionClient.IsOfflineMode())
|
|
{
|
|
@Authenticated
|
|
}
|
|
else if (!ConnectionClient.IsConfigured())
|
|
{
|
|
@NotAuthenticated
|
|
}
|
|
|
|
@code {
|
|
[Parameter] public RenderFragment Authenticated { get; set; }
|
|
[Parameter] public RenderFragment NotAuthenticated { get; set; }
|
|
[Parameter] public bool NoAutoValidate { get; set; }
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
ConnectionClient.OnConnect += (sender, args) => InvokeAsync(StateHasChanged);
|
|
ConnectionClient.OnOfflineModeEnabled += (sender, args) => InvokeAsync(StateHasChanged);
|
|
}
|
|
} |