Skip to content

Commit

Permalink
Merge pull request oqtane#4802 from sbwalker/dev
Browse files Browse the repository at this point in the history
remove custom JavaScript reconnection script for SignalR
  • Loading branch information
sbwalker authored Nov 5, 2024
2 parents a8997e8 + d85a2fc commit 6707ac2
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions Oqtane.Server/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,6 @@
ManageScripts(resources, alias);

// generate scripts
if (_renderMode == RenderModes.Interactive && _runtime == Runtimes.Server)
{
_scripts += CreateReconnectScript();
}
if (site.PwaIsEnabled && site.PwaAppIconFileId != null && site.PwaSplashIconFileId != null)
{
_scripts += CreatePWAScript(alias, site, route);
Expand Down Expand Up @@ -492,25 +488,6 @@
"</script>" + Environment.NewLine;
}

private string CreateReconnectScript()
{
return Environment.NewLine +
"<script>" + Environment.NewLine +
" // Interactive Blazor Server Reconnect" + Environment.NewLine +
" new MutationObserver((mutations, observer) => {" + Environment.NewLine +
" if (document.querySelector('#components-reconnect-modal h5 a')) {" + Environment.NewLine +
" async function attemptReload() {" + Environment.NewLine +
" await fetch('');" + Environment.NewLine +
" location.reload();" + Environment.NewLine +
" }" + Environment.NewLine +
" observer.disconnect();" + Environment.NewLine +
" attemptReload();" + Environment.NewLine +
" setInterval(attemptReload, 5000);" + Environment.NewLine +
" }" + Environment.NewLine +
" }).observe(document.body, { childList: true, subtree: true });" + Environment.NewLine +
"</script>" + Environment.NewLine;
}

private string CreateScrollPositionScript()
{
return Environment.NewLine +
Expand Down

0 comments on commit 6707ac2

Please sign in to comment.