Skip to content

Commit

Permalink
Merge pull request #41 from sayyyho/dev
Browse files Browse the repository at this point in the history
Test: 소켓통신 테스트
  • Loading branch information
sayyyho authored Sep 6, 2024
2 parents ad6a800 + e16d848 commit edfd233
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/pages/ChatPage/ChatPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ export const ChatPage = () => {
if (!username) {
// 로컬 스토리지에 username이 없으면 로딩 페이지로 이동
navigate("/");
window.addEventListener("storage", (event) => {
if (event.key === "username" && event.newValue) {
navigate("/chatting/info/another");
}
});
localStorage.setItem("nextpage", "/chatting/info/another");
} else {
// username이 이미 있는 경우 소켓 연결 설정
socketRef.current = io(`${import.meta.env.VITE_BASE_API}/${params.room}`);
Expand Down
6 changes: 5 additions & 1 deletion src/pages/OnboardingPage/OnboardingPage.4.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export const OnboardingPage4 = () => {
const getUser = async () => {
await getUserID();
setTimeout(() => {
navigate("/home");
if (localStorage.getItem("nextpage")) {
navigate(localStorage.getItem("nextpage"));
} else {
navigate("/home");
}
}, 1000);
};
return (
Expand Down
1 change: 1 addition & 0 deletions src/pages/SharePage/Share.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const Share = () => {
fontFamily: "Nunito",
fontSize: "20px",
fontWeight: 700,
textAlign: "center",
}}
className="grey-btn"
>
Expand Down

0 comments on commit edfd233

Please sign in to comment.