-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#79] 웹 소켓 정상작동 시에 연결 #154
The head ref may contain hidden characters: "79-79-\uC6F9-\uC18C\uCF13-\uC815\uC0C1\uC791\uB3D9-\uC2DC\uC5D0-\uC5F0\uACB0"
Conversation
✅ Deploy Preview for algo-with-me ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
}, []); | ||
const handlePingMessage = useCallback( | ||
(time: Date) => { | ||
console.log('서버에서 온 시간 websocket 연결 확인 용', time); |
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.
console.log 이 부분은 지우지 않고 배포하게 되나요?
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.
�if (process.env.NODE_ENV === "production") { // production에서만 사용할 수 없도록
console = window.console || {};
console.log = function no_console() {}; // console log 막기
console.warn = function no_console() {}; // console warning 막기
console.error = function () {}; // console error 막기
}
이렇게하면 배포할 때, log가 안 찍히게 할 수 있네요.
웹소켓 연결을 대회 페이지에서 계속 확인해야 개발하기 편할 것 같아서 남겨두긴 했습니다.
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.
오오 신기하네요, 감사합니다!
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.
� 왜 자꾸 이런게 생길까요 � <- ???
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.
그러게요 마크다운에서 깨지는 문자가 있나봐요:
const min = 120; | ||
endsAt = new Date(new Date().getTime() + min * 60 * 1000); | ||
|
||
const { remainMiliSeconds, isTimeout } = useSocketTimer({ | ||
socket, | ||
endsAt, | ||
socketEvent: 'ping', | ||
pingTime: 5000, |
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.
상수화 해주시면 더 좋아용
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.
SocketTimer에서 pingTime을 직접 주입하면 범용성이 없는것 같아 SocketTimer를 사용하는 곳에서 넘겨 받도록 했습니다.
현재는 대회 페이지에서 pingTime과 socketEvent를 상수화하고 SocketTimer에서 Props로 전달합니다.
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.
🍡
한 일
실제 화면
2023-11-29.4.07.48.mov