|
@ -153,9 +153,14 @@ function verifyResponse(response, name) { |
|
|
function getFormsAnswers(socketObject, dispatch) { |
|
|
function getFormsAnswers(socketObject, dispatch) { |
|
|
const [socketResponse, setSocketResponse] = useState(); |
|
|
const [socketResponse, setSocketResponse] = useState(); |
|
|
|
|
|
|
|
|
|
|
|
socketObject.socketUrl.onerror = (e) => { |
|
|
|
|
|
console.log(e.message); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
socketObject.socketUrl.onmessage = ({ data }) => { |
|
|
socketObject.socketUrl.onmessage = ({ data }) => { |
|
|
setSocketResponse(data); |
|
|
setSocketResponse(data); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
dispatch({ increment: verifyResponse(socketResponse, socketObject.name) }); |
|
|
dispatch({ increment: verifyResponse(socketResponse, socketObject.name) }); |
|
|
}, [socketResponse]); |
|
|
}, [socketResponse]); |
|
|