From 5071cf47524072fb847138a90ce3742bdbdff481 Mon Sep 17 00:00:00 2001 From: Shaun Walker Date: Tue, 21 Sep 2021 12:48:15 -0400 Subject: [PATCH] modify method for determining Runtime in SiteRouter as ComponentTagHelper "param-" appears to only work on Blazor Server - not on WebAssembly --- Oqtane.Client/App.razor | 12 +++++------- Oqtane.Client/UI/SiteRouter.razor | 5 ++++- Oqtane.Server/Pages/_Host.cshtml | 4 +++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Oqtane.Client/App.razor b/Oqtane.Client/App.razor index 46fc1a1e..1a834052 100644 --- a/Oqtane.Client/App.razor +++ b/Oqtane.Client/App.razor @@ -15,7 +15,7 @@ { - + } @@ -30,15 +30,11 @@ } @code { - [Parameter] - public string Runtime { get; set; } - - [Parameter] - public string RenderMode { get; set; } - private bool _initialized = false; private string _display = "display: none;"; private Installation _installation = new Installation { Success = false, Message = "" }; + private string Runtime = ""; + private string RenderMode = ""; private PageState PageState { get; set; } @@ -62,6 +58,8 @@ { var interop = new Interop(JSRuntime); SiteState.AntiForgeryToken = await interop.GetElementByName(Constants.RequestVerificationToken); + Runtime = await interop.GetElementByName("app_runtime"); + RenderMode = await interop.GetElementByName("app_rendermode"); _display = ""; StateHasChanged(); } diff --git a/Oqtane.Client/UI/SiteRouter.razor b/Oqtane.Client/UI/SiteRouter.razor index 698c2645..321581db 100644 --- a/Oqtane.Client/UI/SiteRouter.razor +++ b/Oqtane.Client/UI/SiteRouter.razor @@ -22,6 +22,9 @@ [Parameter] public string Runtime { get; set; } + [Parameter] + public string RenderMode { get; set; } + [CascadingParameter] PageState PageState { get; set; } @@ -52,7 +55,7 @@ protected override async Task OnParametersSetAsync() { - if (PageState == null) + if (PageState == null && !string.IsNullOrEmpty(Runtime)) { await Refresh(); } diff --git a/Oqtane.Server/Pages/_Host.cshtml b/Oqtane.Server/Pages/_Host.cshtml index 10c13f5b..5352d69c 100644 --- a/Oqtane.Server/Pages/_Host.cshtml +++ b/Oqtane.Server/Pages/_Host.cshtml @@ -20,7 +20,7 @@ @(Html.AntiForgeryToken()) - +
@@ -44,6 +44,8 @@ { } + + @Html.Raw(@Model.BodyResources)