2026-02-07 19:37:04 -06:00
|
|
|
@using LANCommander.Launcher.Enums
|
|
|
|
|
@using Photino.Blazor.CustomWindow.Components
|
2026-01-16 22:43:10 -06:00
|
|
|
@namespace LANCommander.Launcher.UI
|
|
|
|
|
@inherits LayoutComponentBase
|
|
|
|
|
@inject AuthenticationClient AuthenticationClient
|
|
|
|
|
@inject NavigationManager NavigationManager
|
|
|
|
|
@inject LocalizationService LocalizationService
|
|
|
|
|
|
|
|
|
|
<CustomWindow HeaderHeight="37">
|
|
|
|
|
<WindowContent>
|
|
|
|
|
<ErrorHandler Title="@LocalizationService.GetString("LauncherCrashed")">
|
|
|
|
|
<Body>
|
|
|
|
|
<Layout>
|
|
|
|
|
@Body
|
|
|
|
|
</Layout>
|
|
|
|
|
|
|
|
|
|
<UpdateChecker/>
|
|
|
|
|
<AntContainer/>
|
|
|
|
|
</Body>
|
|
|
|
|
|
|
|
|
|
<Extra>
|
2026-01-19 17:04:28 -06:00
|
|
|
<Button Type="ButtonType.Primary" OnClick="@(() => NavigationManager.NavigateTo("/", true))">@LocalizationService.GetString("Reload")</Button>
|
2026-01-16 22:43:10 -06:00
|
|
|
</Extra>
|
|
|
|
|
</ErrorHandler>
|
|
|
|
|
</WindowContent>
|
|
|
|
|
</CustomWindow>
|
|
|
|
|
|
|
|
|
|
@code {
|
2026-02-07 19:37:04 -06:00
|
|
|
[CascadingParameter(Name = "WindowType")]
|
|
|
|
|
public WindowType WindowType { get; set; }
|
|
|
|
|
|
2026-01-16 22:43:10 -06:00
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
if (await AuthenticationClient.ValidateTokenAsync())
|
2026-02-07 19:37:04 -06:00
|
|
|
{
|
|
|
|
|
switch (WindowType)
|
|
|
|
|
{
|
|
|
|
|
case WindowType.Chat:
|
|
|
|
|
NavigationManager.NavigateTo("/Chat");
|
|
|
|
|
break;
|
|
|
|
|
case WindowType.Main:
|
|
|
|
|
default:
|
|
|
|
|
NavigationManager.NavigateTo("/Library");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-01-19 17:04:28 -06:00
|
|
|
else
|
|
|
|
|
NavigationManager.NavigateTo("/Authenticate");
|
2026-01-16 22:43:10 -06:00
|
|
|
}
|
|
|
|
|
}
|