2025-11-09 15:00:46 -06:00
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
2025-12-31 20:01:04 -06:00
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|