diff --git a/Oqtane.Client/App.razor b/Oqtane.Client/App.razor index c7998d71..fa1d4e8d 100644 --- a/Oqtane.Client/App.razor +++ b/Oqtane.Client/App.razor @@ -49,6 +49,9 @@ [Parameter] public string AuthorizationToken { get; set; } + [CascadingParameter] + HttpContext HttpContext { get; set; } + private bool _initialized = false; private string _display = "display: none;"; private Installation _installation = new Installation { Success = false, Message = "" }; @@ -60,6 +63,7 @@ SiteState.RemoteIPAddress = RemoteIPAddress; SiteState.AntiForgeryToken = AntiForgeryToken; SiteState.AuthorizationToken = AuthorizationToken; + SiteState.IsPrerendering = (HttpContext != null) ? true : false; _installation = await InstallationService.IsInstalled(); if (_installation.Alias != null) diff --git a/Oqtane.Shared/Shared/SiteState.cs b/Oqtane.Shared/Shared/SiteState.cs index 02232b7a..5cb9d19a 100644 --- a/Oqtane.Shared/Shared/SiteState.cs +++ b/Oqtane.Shared/Shared/SiteState.cs @@ -9,6 +9,7 @@ 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());