fix(frontend): do not leave room when receiving an error from the backend

This commit is contained in:
2025-03-27 22:33:43 +01:00
parent 3539cb6922
commit c8b9a32f25

View File

@ -277,13 +277,13 @@ class SessionManager {
private handleStatus(message: StatusInfoObj) {
console.log("Status: ", message);
if (message.IsError && message.StatusCode !== "connection_from_different_socket") {
this.leaveRoom();
}
if (message.IsError) {
if (message.StatusCode == "connection_from_different_socket") {
this.socket = null;
window.history.replaceState({}, "", "/");
}
if (message.IsError) {
console.warn("Received error from server: ", message);
}
this.store.update((state) => ({
...state,
messages: [...state.messages, message],