Modifica layout x reconnect handler
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
<script src="_framework/blazor.server.js" autostart="false"></script>
|
||||
|
||||
@*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@
|
||||
<script>
|
||||
@* <script>
|
||||
Blazor.start({
|
||||
reconnectionOptions: {
|
||||
maxRetries: 600,
|
||||
@@ -67,6 +67,22 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
</script> *@
|
||||
<script>
|
||||
Blazor.start({
|
||||
reconnectionOptions: {
|
||||
maxRetries: 600,
|
||||
retryIntervalMilliseconds: 1000
|
||||
},
|
||||
reconnectionHandler: {
|
||||
onConnectionDown: (options, error) => console.error(error),
|
||||
onConnectionUp: () => console.log("Client reconnected!")
|
||||
}
|
||||
}).then(() => {
|
||||
Blazor.defaultReconnectionHandler._reconnectCallback = function (d) {
|
||||
document.location.reload();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user