Cleanup and refactor (#4361)

* fix three panel layout height issue

* rename websocket/services to websocket/persistence, implement LeaveRoom

* cleanup

* add new line eof

* move route components from /components to /containers

* remove duplicate style

Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
Jeremy Letto 2021-05-18 22:06:41 -05:00 committed by GitHub
parent 294229622d
commit 8db9475804
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 127 additions and 76 deletions

View file

@ -24,4 +24,25 @@ export default class RoomCommands {
this.webClient.sendRoomCommand(roomId, rc);
}
}
leaveRoom(roomId) {
var CmdLeaveRoom = this.webClient.pb.Command_LeaveRoom.create();
var rc = this.webClient.pb.RoomCommand.create({
".Command_LeaveRoom.ext" : CmdLeaveRoom
});
this.webClient.sendRoomCommand(roomId, rc, (raw) => {
const { responseCode } = raw;
switch (responseCode) {
case this.webClient.pb.Response.ResponseCode.RespOk:
this.webClient.persistence.room.leaveRoom(roomId);
break;
default:
console.log(`Failed to leave Room ${roomId} [${responseCode}] : `, raw);
}
});
}
}

View file

@ -33,9 +33,9 @@ export default class SessionCommands {
case this.webClient.pb.Response.ResponseCode.RespOk:
const { buddyList, ignoreList, userInfo } = resp;
this.webClient.services.session.updateBuddyList(buddyList);
this.webClient.services.session.updateIgnoreList(ignoreList);
this.webClient.services.session.updateUser(userInfo);
this.webClient.persistence.session.updateBuddyList(buddyList);
this.webClient.persistence.session.updateIgnoreList(ignoreList);
this.webClient.persistence.session.updateUser(userInfo);
this.webClient.commands.session.listUsers();
this.webClient.commands.session.listRooms();
@ -97,7 +97,7 @@ export default class SessionCommands {
if (response) {
switch (responseCode) {
case this.webClient.pb.Response.ResponseCode.RespOk:
this.webClient.services.session.updateUsers(response.userList);
this.webClient.persistence.session.updateUsers(response.userList);
break;
default:
console.log(`Failed to fetch Server Rooms [${responseCode}] : `, raw);
@ -135,7 +135,7 @@ export default class SessionCommands {
case this.webClient.pb.Response.ResponseCode.RespOk:
const { roomInfo } = raw[".Response_JoinRoom.ext"];
this.webClient.services.room.joinRoom(roomInfo);
this.webClient.persistence.room.joinRoom(roomInfo);
this.webClient.debug(() => console.log("Join Room: ", roomInfo.name));
return;
case this.webClient.pb.Response.ResponseCode.RespNameNotFound:
@ -217,7 +217,7 @@ export default class SessionCommands {
const { logMessage } = raw[".Response_ViewLogHistory.ext"];
console.log("Response_ViewLogHistory: ", logMessage)
this.webClient.services.session.viewLogs(logMessage)
this.webClient.persistence.session.viewLogs(logMessage)
this.webClient.debug(() => console.log("View Log History: ", logMessage));
return;