LANCommander/LANCommander.Launcher/UI/Components/RedirectToRoute.cs
Pat Hartl 698a7523b6 Code cleanup
- Move all Launcher components to LANCommander.Launcher.UI namespace
- Move all SCSS files next to components (when possible)
- Refactor styles that control overflow of content into titlebar to MainWindow only
- Remove use in launcher UI of SDK.Client
2025-12-31 20:01:04 -06:00

20 lines
No EOL
492 B
C#

using Microsoft.AspNetCore.Components;
namespace LANCommander.Launcher.UI;
public partial class RedirectToRoute : ComponentBase
{
[Parameter]
public required string Route { get; set; }
[Inject]
private NavigationManager NavigationManager { get; set; } = null!;
protected override void OnInitialized()
{
var uri = new Uri(NavigationManager.Uri);
if (uri.LocalPath != Route)
NavigationManager.NavigateTo(Route, true);
}
}