mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
cleanup and unit tests (#4434)
* put socket.updateHistory behind SessionCommand * rename /websocket files from .tsx to .ts * add unit tests to websocket commands * complete unit tests for webClient commands * secure wss Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
e9ba195d7d
commit
f75ff2a7c8
14 changed files with 611 additions and 48 deletions
|
|
@ -72,7 +72,7 @@ function connectionClosed({ reason, reasonStr }: ConnectionClosedData) {
|
|||
}
|
||||
}
|
||||
|
||||
webClient.socket.updateStatus(StatusEnum.DISCONNECTED, message);
|
||||
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, message);
|
||||
}
|
||||
|
||||
function listRooms({ roomList }: ListRoomsData) {
|
||||
|
|
@ -116,13 +116,13 @@ function serverIdentification(info: ServerIdentificationData) {
|
|||
|
||||
if (protocolVersion !== webClient.protocolVersion) {
|
||||
SessionCommands.disconnect();
|
||||
webClient.socket.updateStatus(StatusEnum.DISCONNECTED, "Protocol version mismatch: " + protocolVersion);
|
||||
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, "Protocol version mismatch: " + protocolVersion);
|
||||
return;
|
||||
}
|
||||
|
||||
webClient.resetConnectionvars();
|
||||
webClient.socket.updateStatus(StatusEnum.LOGGINGIN, "Logging in...");
|
||||
SessionPersistence.updateInfo(serverName, serverVersion);
|
||||
SessionCommands.updateStatus(StatusEnum.LOGGINGIN, "Logging in...");
|
||||
SessionCommands.login();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue