Skip to content

Commit f382be0

Browse files
committed
TODOs and notes
1 parent 97cf5ca commit f382be0

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

‎back/src/messages/output-processor.ts‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export const processOuputMessage = (socketInfo: SocketInfo, action: Action) => {
4242
case OutputMessageTypes.REPLACE_FULL_TEXT:
4343
handleReplaceFullText(socketInfo, action.payload);
4444
case OutputMessageTypes.STUDENT_SEND_FULL_CONTENT:
45-
handleStudentSendContent(socketInfo);
45+
handleSingleStudentSendFullContent(socketInfo);
4646
}
4747
};
4848

49-
const handleStudentSendContent = (socketInfo: SocketInfo) => {
49+
const handleSingleStudentSendFullContent = (socketInfo: SocketInfo) => {
5050
const room = getRoomFromConnectionId(socketInfo.connectionId);
5151
const content = getRoomContent(room);
5252

@@ -56,10 +56,14 @@ const handleStudentSendContent = (socketInfo: SocketInfo) => {
5656
});
5757
};
5858

59+
// TODO: replace with handleSingleStudentSendFullContent code
60+
// but instead of using socketInfo.socket.emit use
61+
// socketInfo.io.in(room)
5962
const handleReplaceFullText = (socketInfo: SocketInfo, text: string) => {
6063
const room = getRoomFromConnectionId(socketInfo.connectionId);
6164
socketInfo.io.in(room).emit(SocketOuputMessageLiteral.MESSAGE, {
62-
type: responseType.REPLACE_FULL_TEXT,
65+
// TODO: remove from const list REPLACE_FULL_TEXT
66+
type: responseType.REPLACE_FULL_TEXT, //STUDENT_GET_FULL_CONTENT
6367
payload: text,
6468
});
6569
};

‎front/src/pods/trainer/trainer.container.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ export const TrainerContainer = () => {
6868
sendTrainerTextToServer(finalText);
6969
};
7070

71+
// TODO:
72+
// 1. Make the trainer full texta area editable
73+
// 2. Add a send full text button at the bottom
74+
// 3. Connect that button with this handler
75+
const handleSendFullContentLog = (fullContent: string): void => {
76+
// sendFullTextToServer
77+
// socketRef.current.emit(SocketOutputMessageLiteral.MESSAGE, {
78+
// type: socketEmitMessageTypes.SEND_FULL_CONTENT
79+
// payload: fullContent
80+
//})
81+
};
82+
7183
return (
7284
<TrainerComponent
7385
handleAppendTrainerText={handleAppendTrainerText}

0 commit comments

Comments
 (0)