Skip to content

Commit f812dcf

Browse files
committed
Fix: Wrong username shown after sending text chat
1 parent b4f4e01 commit f812dcf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

frontend/src/app/collaboration/components/question.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ const Question = ({
6363
console.log(question);
6464

6565
const packageMessage = (message: SingleChatLogApiResponse): ChatLog => {
66+
const userId = getUserId();
6667
return {
6768
text: message.message,
68-
title: collaborator,
69+
title: message.senderId === userId ? username : collaborator,
6970
date: new Date(message.timestamp),
70-
position: message.senderId === getUserId() ? "right" : "left",
71+
position: message.senderId === userId ? "right" : "left",
7172
type: "text",
7273
};
7374
};

0 commit comments

Comments
 (0)