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(); const socket = getSocket();
localStorage.setItem('name', value) 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]) }, [value])
console.log(getSocket())
return ( return (
<MainWrapper> <MainWrapper>
<StartWrapper> <StartWrapper>
@ -69,11 +67,6 @@ export const UserPage = () => {
</IconButton> </IconButton>
</InputWrapper> </InputWrapper>
</form> </form>
<pre>
{JSON.stringify(getSocket()?.connected, null, 4)}
{JSON.stringify(getSocket()?.id, null, 4)}
</pre>
</StartWrapper> </StartWrapper>
</MainWrapper> </MainWrapper>
) )