This commit is contained in:
Primakov Alexandr Alexandrovich 2023-04-16 13:03:00 +03:00
parent 412d6377bd
commit c42fc56644

View File

@ -42,11 +42,9 @@ export const UserPage = () => {
const socket = getSocket();
localStorage.setItem('name', value)
socket.emit('add', { socketId, name: value, lessonid: lessonId });
socket.emit('add', { socketId: localStorage.getItem('socketId') || socketId, name: value, lessonid: lessonId });
}, [value])
console.log(getSocket())
return (
<MainWrapper>
<StartWrapper>
@ -69,11 +67,6 @@ export const UserPage = () => {
</IconButton>
</InputWrapper>
</form>
<pre>
{JSON.stringify(getSocket()?.connected, null, 4)}
{JSON.stringify(getSocket()?.id, null, 4)}
</pre>
</StartWrapper>
</MainWrapper>
)