LANCommander/LANCommander.Launcher/UI/Components/RedirectToRoute.cs

20 lines
492 B
C#
Raw Permalink Normal View History

2025-11-09 15:00:46 -06:00
using Microsoft.AspNetCore.Components;
namespace LANCommander.Launcher.UI;
2025-11-09 15:00:46 -06:00
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)
2025-11-13 18:17:30 -06:00
NavigationManager.NavigateTo(Route, true);
2025-11-09 15:00:46 -06:00
}
}