Improve disconnected message in public mode
This commit is contained in:
parent
f00dfc7524
commit
d0444d7d7f
@ -11,7 +11,7 @@ socket.on("reconnecting", function(attempt) {
|
||||
});
|
||||
|
||||
socket.on("connecting", function() {
|
||||
store.commit("currentUserVisibleError", `Connecting…`);
|
||||
store.commit("currentUserVisibleError", "Connecting…");
|
||||
updateLoadingMessage();
|
||||
});
|
||||
|
||||
@ -29,6 +29,16 @@ function handleDisconnect(data) {
|
||||
const message = data.message || data;
|
||||
|
||||
store.commit("isConnected", false);
|
||||
|
||||
if (!socket.io.reconnection()) {
|
||||
store.commit(
|
||||
"currentUserVisibleError",
|
||||
`Disconnected from the server (${message}), The Lounge does not reconnect in public mode.`
|
||||
);
|
||||
updateLoadingMessage();
|
||||
return;
|
||||
}
|
||||
|
||||
store.commit("currentUserVisibleError", `Waiting to reconnect… (${message})`);
|
||||
updateLoadingMessage();
|
||||
|
||||
|
@ -9,4 +9,9 @@ const socket = io({
|
||||
reconnection: !document.body.classList.contains("public"),
|
||||
});
|
||||
|
||||
// Ease debugging socket during development
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
window.socket = socket;
|
||||
}
|
||||
|
||||
export default socket;
|
||||
|
Loading…
Reference in New Issue
Block a user