Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Overnap
2021-06-08 06:42:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e808c4d46fb7e5622914bd071bcb4226e258b4f9
e808c4d4
1 parent
fab98c87
Builds for 1 pipeline
failed
in 1 minute 24 seconds
방 목록 수신에 문제가 있다면 로그인 화면으로 강제 전송 추가
Changes
1
Builds
3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
web/src/pages/Rooms.tsx
web/src/pages/Rooms.tsx
View file @
e808c4d
import React, { useCallback, useContext, useEffect, useState } from 'react';
import { useHistory } from 'react-router';
import { Main } from '../components/common/Main';
import { MessageResponse, MessageType, RawMessage } from '../components/common/types';
import { RoomBlock } from '../components/rooms/RoomBlock';
...
...
@@ -6,6 +7,7 @@ import { Room } from '../components/rooms/types';
import SocketContext from '../contexts/SocketContext';
export const Rooms: React.FC = () => {
const history = useHistory();
const socket = useContext(SocketContext);
const [ rooms, setRooms ] = useState<Room[]>([]);
...
...
@@ -18,9 +20,8 @@ export const Rooms: React.FC = () => {
if (response.ok) {
setRooms(response.result!);
} else {
// TODO: 에러 핸들링
console.log("방 목록을 수신하지 못함");
console.log(response);
// 로그인하지 않고 방 목록으로 왔다고 판단
history.push('/');
}
});
}, []);
...
...
Please
register
or
login
to post a comment