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-10 18:41:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
52fd9f34daa184d3761ebabfff3ff25ded73a775
52fd9f34
1 parent
3fb21be1
방이 하나도 없을 때 안내 메세지 추가
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
web/src/pages/Rooms.tsx
web/src/pages/Rooms.tsx
View file @
52fd9f3
...
...
@@ -28,7 +28,12 @@ const Rooms: React.FC = () => {
});
}, []);
useEffect(refreshRooms, []);
useEffect(() => {
// 뒤로가기 키로 빠져나오면 ping listener를 unsubscribe
socket.off('ping');
refreshRooms();
}, []);
return (
<Main>
...
...
@@ -37,7 +42,11 @@ const Rooms: React.FC = () => {
<Create />
</div>
<div className='mt-auto w-screen flex flex-col items-center'>
{rooms.map((room) => (<RoomBlock key={room.uuid} room={room} />))}
{
rooms.length > 0 ?
rooms.map((room) => (<RoomBlock key={room.uuid} room={room} />))
: (<div className='text-lg'>There's no room at all.</div>)
}
</div>
</Main>
)
...
...
Please
register
or
login
to post a comment