@inherits LayoutComponentBase
@using Microsoft.AspNetCore.Diagnostics
@inject CurrentUser Me
@inject IHttpContextAccessor Http
@T["Skip to content"]
@Body
@* Opened by the "?" key or the footer link (app.js). *@
@code {
/// The search box keeps what was searched for on the repository list.
private string? Query =>
Http.HttpContext is { } context && context.Request.Path == "/" ? context.Request.Query["q"].ToString() : null;
/// Where the language switcher returns to: the page the visitor asked for, even when an error page is shown instead.
private string ReturnUrl
{
get
{
var context = Http.HttpContext;
if (context is null)
{
return "/";
}
var original = context.Features.Get();
return original is not null
? original.OriginalPathBase + original.OriginalPath + original.OriginalQueryString
: context.Request.PathBase + context.Request.Path + context.Request.QueryString;
}
}
}