Skip to content

Conversation

@ayeletBinder
Copy link
Collaborator

No description provided.

let cntUnreadMessages = messages.filter(message => !message.read).length;
const MessageIcon = () => {
const [openMesagges,setOpenMesagges] = useState(false);
const userId = '66961bef8ca0916dcbfdabc3'; //change the userId according the correct user...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can't insert code with hard-code values

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but now i dont have userId, so what to put here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should come from the redux.

const [socket, setSocket] = useState(null);

useEffect(() => {
const ws = new WebSocket('ws://localhost:8080');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please save the ws url in env variable

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comments as other files, please notice:

  1. each res.status or next should have return statements and status code
  2. access to collections and logics should be in service file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[server-side/controllers/messageType.controller.js is not my page - i didnt wrote them.
you dont have to uploud it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't upload only part of the branch, you should be care that the changes that exists in your branch are only yours

const eventEmitter = new EventEmitter();

wss.on('connection', (ws) => {
console.log('Client connected');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console logs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants