-
Notifications
You must be signed in to change notification settings - Fork 7
Ayelet/count message #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Ayelet/count message #147
Conversation
| 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... |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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:
- each res.status or next should have return statements and status code
- access to collections and logics should be in service file.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
server-side/webSocket.js
Outdated
| const eventEmitter = new EventEmitter(); | ||
|
|
||
| wss.on('connection', (ws) => { | ||
| console.log('Client connected'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove console logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed
No description provided.