fix #3438 - remove IsPrerendering property as it is not used, and remove reference to HttpContext
This commit is contained in:
parent
d11669e613
commit
7a748bd142
@ -2,7 +2,6 @@
|
||||
@inject IInstallationService InstallationService
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject SiteState SiteState
|
||||
@inject IServiceProvider ServiceProvider
|
||||
|
||||
@if (_initialized)
|
||||
{
|
||||
@ -56,24 +55,12 @@
|
||||
|
||||
private PageState PageState { get; set; }
|
||||
|
||||
private IHttpContextAccessor accessor;
|
||||
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
SiteState.RemoteIPAddress = RemoteIPAddress;
|
||||
SiteState.AntiForgeryToken = AntiForgeryToken;
|
||||
SiteState.AuthorizationToken = AuthorizationToken;
|
||||
|
||||
accessor = (IHttpContextAccessor)ServiceProvider.GetService(typeof(IHttpContextAccessor));
|
||||
if (accessor != null)
|
||||
{
|
||||
SiteState.IsPrerendering = !accessor.HttpContext.Response.HasStarted;
|
||||
}
|
||||
else
|
||||
{
|
||||
SiteState.IsPrerendering = true;
|
||||
}
|
||||
|
||||
_installation = await InstallationService.IsInstalled();
|
||||
if (_installation.Alias != null)
|
||||
{
|
||||
|
@ -9,7 +9,6 @@ namespace Oqtane.Shared
|
||||
public string AntiForgeryToken { get; set; } // passed from server for use in service calls on client
|
||||
public string AuthorizationToken { get; set; } // passed from server for use in service calls on client
|
||||
public string RemoteIPAddress { get; set; } // passed from server as cannot be reliably retrieved on client
|
||||
public bool IsPrerendering{ get; set; }
|
||||
|
||||
private dynamic _properties;
|
||||
public dynamic Properties => _properties ?? (_properties = new PropertyDictionary());
|
||||
|
Reference in New Issue
Block a user