26 lines
374 B
Plaintext
26 lines
374 B
Plaintext
@page "/play/{sessionId}"
|
|
|
|
@inject GameHubNode node
|
|
|
|
@if (string.IsNullOrWhiteSpace(SessionId))
|
|
{
|
|
return;
|
|
}
|
|
<main class="PrimaryTheme">
|
|
<GameBoard SessionId="@SessionId" />
|
|
</main>
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
public string? SessionId { get; set; }
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
if (!node.IsConnected)
|
|
{
|
|
await node.BeginListen();
|
|
}
|
|
}
|
|
}
|