error to pre
This commit is contained in:
parent
109d51115b
commit
412d6377bd
@ -5,7 +5,7 @@
|
||||
"main": "./src/index.tsx",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "ijl-cli --server --port=8099",
|
||||
"start": "ijl-cli --server --port=8099 --with-open-browser",
|
||||
"build": "npm run clean && ijl-cli --build --dev",
|
||||
"build:prod": "npm run clean && ijl-cli --build",
|
||||
"clean": "rimraf dist"
|
||||
|
@ -7,6 +7,7 @@ import arrow from '../assets/36-arrow-right.svg';
|
||||
|
||||
export const UserPage = () => {
|
||||
const [socketId, setSocketId] = useState(null);
|
||||
const [error, setError] = useState(null);
|
||||
const { lessonId } = useParams();
|
||||
useEffect(() => {
|
||||
connect();
|
||||
@ -26,8 +27,8 @@ export const UserPage = () => {
|
||||
socket.emit('add', { socketId: id || socket.id, name, lessonid: lessonId });
|
||||
}
|
||||
})
|
||||
socket.on('lessons', data => {
|
||||
// setLessons(data)
|
||||
socket.on('error', data => {
|
||||
setError(data)
|
||||
})
|
||||
}, []);
|
||||
|
||||
@ -44,6 +45,8 @@ export const UserPage = () => {
|
||||
socket.emit('add', { socketId, name: value, lessonid: lessonId });
|
||||
}, [value])
|
||||
|
||||
console.log(getSocket())
|
||||
|
||||
return (
|
||||
<MainWrapper>
|
||||
<StartWrapper>
|
||||
@ -66,6 +69,11 @@ export const UserPage = () => {
|
||||
</IconButton>
|
||||
</InputWrapper>
|
||||
</form>
|
||||
|
||||
<pre>
|
||||
{JSON.stringify(getSocket()?.connected, null, 4)}
|
||||
{JSON.stringify(getSocket()?.id, null, 4)}
|
||||
</pre>
|
||||
</StartWrapper>
|
||||
</MainWrapper>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user