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 00:26:20 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
74bead5c6ce3f5d6d96938f2e34190c1ef2d8018
74bead5c
2 parents
f6e8ff95
2964bc98
Builds for 1 pipeline
passed
in 8 minutes 4 seconds
Merge branch 'bugfix/room' into develop
Changes
3
Builds
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
web/src/components/room/Chat.tsx
web/src/components/room/Ready.tsx
web/src/pages/Room.tsx
web/src/components/room/Chat.tsx
View file @
74bead5
...
...
@@ -37,8 +37,6 @@ export const Chat: React.FC<ChatProps> = (props) => {
const handleEnter = useCallback((e: React.KeyboardEvent) => {
if (e.key === 'Enter') {
// setChatLines([...chatLines, { sender: 'me', message: input }]);
const rawMessage: RawMessage = {
type: MessageType.ROOM_CHAT,
message: { message: input }
...
...
web/src/components/room/Ready.tsx
View file @
74bead5
...
...
@@ -25,8 +25,8 @@ export const Ready: React.FC<ReadyProps> = ({ users }) => {
setIsAdmin(me?.admin || false);
setIsReady(me?.ready || false);
const test = true
;
users.forEach(x => test
&& x.ready
);
var test = users.length > 1
;
users.forEach(x => test
= test && (x.ready || x.admin)
);
setIsAllReady(test);
});
...
...
@@ -47,7 +47,7 @@ export const Ready: React.FC<ReadyProps> = ({ users }) => {
}, [isAdmin, isReady, isAllReady]);
return (
<button className={`${isAdmin ? isAllReady ? 'bg-green-500' : 'bg-gray-400'
<button className={`${isAdmin ? isAllReady ? 'bg-green-500
active:bg-green-600
' : 'bg-gray-400'
: isReady ? 'bg-green-600'
: 'bg-green-500 active:bg-green-600'}
text-white font-bold uppercase
...
...
web/src/pages/Room.tsx
View file @
74bead5
...
...
@@ -34,7 +34,7 @@ export const Room: React.FC = () => {
const data = rawMessage.message as UpdateRoomUser;
if (data.state == 'removed') {
const newUsers = roomData.users;
const index = newUsers.
indexOf(data.user
);
const index = newUsers.
findIndex(x => x.username === data.user.username
);
if (index < 0) {
console.log('존재하지 않는 유저를 제거 시도');
} else {
...
...
Please
register
or
login
to post a comment