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