From 7a748bd142f64dc507331c13caaeef8906f92c82 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 7 Nov 2023 13:49:54 -0500 Subject: [PATCH] fix #3438 - remove IsPrerendering property as it is not used, and remove reference to HttpContext --- Oqtane.Client/App.razor | 13 ------------- Oqtane.Shared/Shared/SiteState.cs | 1 - 2 files changed, 14 deletions(-) diff --git a/Oqtane.Client/App.razor b/Oqtane.Client/App.razor index 701faf81..c7998d71 100644 --- a/Oqtane.Client/App.razor +++ b/Oqtane.Client/App.razor @@ -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) { diff --git a/Oqtane.Shared/Shared/SiteState.cs b/Oqtane.Shared/Shared/SiteState.cs index 50481f65..02232b7a 100644 --- a/Oqtane.Shared/Shared/SiteState.cs +++ b/Oqtane.Shared/Shared/SiteState.cs @@ -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());