Use the automatic SignalR reconnect feature (#22694)

pull/22707/head
Esteban Luchsinger 2021-07-09 23:58:46 +02:00 committed by GitHub
parent 81f91220fd
commit b56a633786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -36,8 +36,14 @@ document.addEventListener("DOMContentLoaded", () => {
setTimeout(start, 5000); setTimeout(start, 5000);
} }
}; };
connection.onclose(start); connection.onclose(function (error) {
if (error) {
console.log(`Connection closed with error: ${error}`);
} else {
console.log("Connection closed.");
}
});
// Start the connection. // Start the connection.
start(); start();