Use the automatic SignalR reconnect feature (#22694)
parent
81f91220fd
commit
b56a633786
|
@ -36,8 +36,14 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||
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();
|
||||
|
|
Loading…
Reference in New Issue