nft-faucet/NftFaucet/Extensions/NavigationManagerExtensions.cs
Ivan Yaremenchuk 02282313af Fix navigation
2022-04-03 23:10:40 +02:00

21 lines
505 B
C#

using Microsoft.AspNetCore.Components;
namespace NftFaucet.Extensions;
public static class NavigationManagerExtensions
{
public static void NavigateToRelative(this NavigationManager uriHelper, string relativePath)
{
var newUri = uriHelper.BaseUri;
if (!newUri.EndsWith("/"))
newUri += "/";
if (relativePath.StartsWith("/"))
relativePath = relativePath.Substring(1);
newUri += relativePath;
uriHelper.NavigateTo(newUri);
}
}