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

@ -2,6 +2,6 @@ export const JoinRoom = {
id: ".Event_JoinRoom.ext",
action: ({ userInfo }, webClient, { roomEvent }) => {
const { roomId } = roomEvent;
webClient.services.room.userJoined(roomId, userInfo);
webClient.persistence.room.userJoined(roomId, userInfo);
}
};
};

View file

@ -2,6 +2,6 @@ export const LeaveRoom = {
id: ".Event_LeaveRoom.ext",
action: ({ name }, webClient, { roomEvent }) => {
const { roomId } = roomEvent;
webClient.services.room.userLeft(roomId, name);
webClient.persistence.room.userLeft(roomId, name);
}
};
};

View file

@ -2,6 +2,6 @@ export const ListGames = {
id: ".Event_ListGames.ext",
action: ({ gameList }, webClient, { roomEvent }) => {
const { roomId } = roomEvent;
webClient.services.room.updateGames(roomId, gameList);
webClient.persistence.room.updateGames(roomId, gameList);
}
};
};

View file

@ -2,6 +2,6 @@ export const RoomSay = {
id: ".Event_RoomSay.ext",
action: (message, webClient, { roomEvent }) => {
const { roomId } = roomEvent;
webClient.services.room.addMessage(roomId, message);
webClient.persistence.room.addMessage(roomId, message);
}
};
};

View file

@ -3,11 +3,11 @@ export const AddToList = {
action: ({ listName, userInfo}, webClient) => {
switch (listName) {
case 'buddy': {
webClient.services.session.addToBuddyList(userInfo);
webClient.persistence.session.addToBuddyList(userInfo);
break;
}
case 'ignore': {
webClient.services.session.addToIgnoreList(userInfo);
webClient.persistence.session.addToIgnoreList(userInfo);
break;
}
default: {

View file

@ -3,7 +3,7 @@ import * as _ from "lodash";
export const ListRooms = {
id: ".Event_ListRooms.ext",
action: ({ roomList }, webClient) => {
webClient.services.room.updateRooms(roomList);
webClient.persistence.room.updateRooms(roomList);
if (webClient.options.autojoinrooms) {
_.each(roomList, ({ autoJoin, roomId }) => {

View file

@ -3,11 +3,11 @@ export const RemoveFromList = {
action: ({ listName, userName }, webClient) => {
switch (listName) {
case 'buddy': {
webClient.services.session.removeFromBuddyList(userName);
webClient.persistence.session.removeFromBuddyList(userName);
break;
}
case 'ignore': {
webClient.services.session.removeFromIgnoreList(userName);
webClient.persistence.session.removeFromIgnoreList(userName);
break;
}
default: {

View file

@ -13,7 +13,7 @@ export const ServerIdentification = {
webClient.resetConnectionvars();
webClient.updateStatus(StatusEnum.LOGGINGIN, "Logging in...");
webClient.services.session.updateInfo(serverName, serverVersion);
webClient.persistence.session.updateInfo(serverName, serverVersion);
webClient.commands.session.login();
}
};

View file

@ -1,6 +1,6 @@
export const ServerMessage = {
id: ".Event_ServerMessage.ext",
action: ({ message }, webClient) => {
webClient.services.session.serverMessage(message);
webClient.persistence.session.serverMessage(message);
}
};
};

View file

@ -1,6 +1,6 @@
export const UserJoined = {
id: ".Event_UserJoined.ext",
action: ({ userInfo }, webClient) => {
webClient.services.session.userJoined(userInfo);
webClient.persistence.session.userJoined(userInfo);
}
};
};

View file

@ -1,6 +1,6 @@
export const UserLeft = {
id: ".Event_UserLeft.ext",
action: ({ name }, webClient) => {
webClient.services.session.userLeft(name);
webClient.persistence.session.userLeft(name);
}
};
};