diff --git a/Oqtane.Server/Components/App.razor b/Oqtane.Server/Components/App.razor index 30230e75..92e9c330 100644 --- a/Oqtane.Server/Components/App.razor +++ b/Oqtane.Server/Components/App.razor @@ -40,7 +40,7 @@ - @if (!string.IsNullOrEmpty(_PWAScript)) + @if (_scripts.Contains("PWA Manifest")) { } @@ -74,9 +74,7 @@ - @((MarkupString)_reconnectScript) - @((MarkupString)_PWAScript) - @((MarkupString)_scrollPositionScript) + @((MarkupString)_scripts) @((MarkupString)_bodyResources) } else @@ -101,9 +99,7 @@ private string _headResources = ""; private string _bodyResources = ""; private string _styleSheets = ""; - private string _reconnectScript = ""; // for Interactive render mode and Blazor Server interactivity only - private string _PWAScript = ""; // for PWA apps only - private string _scrollPositionScript = ""; // for Static render mode only + private string _scripts = ""; private string _message = ""; private PageState _pageState; @@ -177,17 +173,18 @@ ManageStyleSheets(resources); ManageScripts(resources, alias); + // generate scripts if (_renderMode == RenderModes.Interactive && _runtime == Runtimes.Server) { - _reconnectScript = CreateReconnectScript(); + _scripts += CreateReconnectScript(); } if (site.PwaIsEnabled && site.PwaAppIconFileId != null && site.PwaSplashIconFileId != null) { - _PWAScript = CreatePWAScript(alias, site, route); + _scripts += CreatePWAScript(alias, site, route); } @if (_renderMode == RenderModes.Static) { - _scrollPositionScript = CreateScrollPositionScript(); + _scripts += CreateScrollPositionScript(); } _headResources += ParseScripts(site.HeadContent); @@ -492,17 +489,18 @@ { return ""; }