From 98010f6125a217abf6f1257572d0d57ff9a52e45 Mon Sep 17 00:00:00 2001 From: ijun17 Date: Mon, 23 Dec 2024 23:27:59 +0900 Subject: [PATCH 01/10] =?UTF-8?q?chore:=20cross-env=20=EC=84=A4=EC=B9=98?= =?UTF-8?q?=20=EB=B0=8F=20npm=20audit=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/package-lock.json | 26 +++++++++++++++++++++++--- FE/package.json | 7 ++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/FE/package-lock.json b/FE/package-lock.json index f15ee83a..431435e8 100644 --- a/FE/package-lock.json +++ b/FE/package-lock.json @@ -29,6 +29,7 @@ "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.3", "autoprefixer": "^10.4.20", + "cross-env": "^7.0.3", "eslint": "^9.13.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", @@ -2884,6 +2885,25 @@ "node": ">= 6" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -4181,9 +4201,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "dev": true, "funding": [ { diff --git a/FE/package.json b/FE/package.json index 7afcc8d4..2ed3d591 100644 --- a/FE/package.json +++ b/FE/package.json @@ -5,8 +5,8 @@ "type": "module", "scripts": { "dev": "vite --host", - "build": "tsc -b && NODE_ENV=production vite build", - "build-dev": "tsc -b && NODE_ENV=development vite build", + "build": "tsc -b && cross-env NODE_ENV=production vite build", + "build-dev": "tsc -b && cross-env NODE_ENV=development vite build", "lint": "eslint .", "preview": "vite preview" }, @@ -32,6 +32,7 @@ "@types/react-dom": "^18.3.1", "@vitejs/plugin-react": "^4.3.3", "autoprefixer": "^10.4.20", + "cross-env": "^7.0.3", "eslint": "^9.13.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.2.1", @@ -51,4 +52,4 @@ "public" ] } -} \ No newline at end of file +} From 3b22efc37e17e5fe699c8626aacb6b3ad145f408 Mon Sep 17 00:00:00 2001 From: ijun17 Date: Mon, 23 Dec 2024 23:29:41 +0900 Subject: [PATCH 02/10] =?UTF-8?q?feat:=20updatePosition=20=EB=B0=8F=20chat?= =?UTF-8?q?Message=20=EB=B0=B0=EC=B9=98=20=EC=A0=81=EC=9A=A9=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/api/socket/socketEventTypes.ts | 4 ++-- FE/src/features/game/data/socketListener.ts | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/FE/src/api/socket/socketEventTypes.ts b/FE/src/api/socket/socketEventTypes.ts index 6be4a24e..6b62ab4c 100644 --- a/FE/src/api/socket/socketEventTypes.ts +++ b/FE/src/api/socket/socketEventTypes.ts @@ -126,11 +126,11 @@ type UpdateHostResponse = { export type SocketDataMap = { chatMessage: { request: ChatMessageRequest; - response: ChatMessageResponse; + response: ChatMessageResponse | ChatMessageResponse[]; }; updatePosition: { request: UpdatePositionRequest; - response: UpdatePositionResponse; + response: UpdatePositionResponse | UpdatePositionResponse[]; }; createRoom: { request: null; diff --git a/FE/src/features/game/data/socketListener.ts b/FE/src/features/game/data/socketListener.ts index cfc77a38..f3976a54 100644 --- a/FE/src/features/game/data/socketListener.ts +++ b/FE/src/features/game/data/socketListener.ts @@ -10,7 +10,13 @@ import { getEmojiByUUID } from '../utils/emoji'; // chat socketService.on('chatMessage', (data) => { - useChatStore.getState().addMessage(data); + if(Array.isArray(data)){ + data.forEach((e)=>{ + useChatStore.getState().addMessage(e); + }) + }else{ + useChatStore.getState().addMessage(data); + } }); // player @@ -34,7 +40,13 @@ socketService.on('joinRoom', (data) => { }); socketService.on('updatePosition', (data) => { - usePlayerStore.getState().updatePlayerPosition(data.playerId, data.playerPosition); + if(Array.isArray(data)){ + data.forEach((e)=>{ + usePlayerStore.getState().updatePlayerPosition(e.playerId, e.playerPosition); + }) + }else{ + usePlayerStore.getState().updatePlayerPosition(data.playerId, data.playerPosition); + } }); socketService.on('endQuizTime', (data) => { From a7768664176e5957ef3b63237a081f3862fdc335 Mon Sep 17 00:00:00 2001 From: ijun17 Date: Tue, 24 Dec 2024 00:41:22 +0900 Subject: [PATCH 03/10] =?UTF-8?q?design:=20=ED=80=B4=EC=A6=88=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=A4=84=EB=B0=94=EA=BF=88=203=EC=A4=84?= =?UTF-8?q?=EA=B9=8C=EC=A7=80=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/components/QuizPreview.tsx | 5 ++--- FE/src/features/game/components/QuizSetSearchList.tsx | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/FE/src/components/QuizPreview.tsx b/FE/src/components/QuizPreview.tsx index 301085fe..e4a441fc 100644 --- a/FE/src/components/QuizPreview.tsx +++ b/FE/src/components/QuizPreview.tsx @@ -7,14 +7,13 @@ type Props = { export const QuizPreview = ({ title, description }: Props) => { return ( -
+
- {/* {title} */}
-

{title}

+

{title}

{description}

diff --git a/FE/src/features/game/components/QuizSetSearchList.tsx b/FE/src/features/game/components/QuizSetSearchList.tsx index 6390adaa..ee6554e3 100644 --- a/FE/src/features/game/components/QuizSetSearchList.tsx +++ b/FE/src/features/game/components/QuizSetSearchList.tsx @@ -87,7 +87,7 @@ const QuizSetSearchList = ({ onClick, search }: Params) => { {data?.pages.map((page) => page?.data.map((e) => (
{ setSelectedQuizSet(e); onClick(e); From 0888868e43bb202ad4f0543154b57852391aef5a Mon Sep 17 00:00:00 2001 From: ijun17 Date: Tue, 24 Dec 2024 00:44:31 +0900 Subject: [PATCH 04/10] =?UTF-8?q?design:=20=ED=94=8C=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=96=B4=20=EB=94=94=EC=8A=A4=ED=94=8C=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=ED=94=8C=EB=A0=88=EC=9D=B4=EC=96=B4=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EC=A4=84=EB=B0=94=EA=BF=88=20=EB=B0=A9?= =?UTF-8?q?=EC=A7=80=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../game/components/ParticipantDisplay.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/FE/src/features/game/components/ParticipantDisplay.tsx b/FE/src/features/game/components/ParticipantDisplay.tsx index 2414167e..c99b1c2e 100644 --- a/FE/src/features/game/components/ParticipantDisplay.tsx +++ b/FE/src/features/game/components/ParticipantDisplay.tsx @@ -34,9 +34,11 @@ const ParticipantDisplay: React.FC = ({ gameState }) => className="flex justify-between mt-2 pb-2 border-b border-default items-center" key={player.playerId} > -
{player.emoji + ' ' + player.playerName}
+
+ {player.emoji + ' ' + player.playerName}{' '} +
{player.isHost && ( - + λ°©μž₯ πŸ‘‘ )} @@ -68,7 +70,9 @@ const ParticipantDisplay: React.FC = ({ gameState }) => layout transition={{ type: 'spring', stiffness: 100, damping: 20 }} > -
{player.emoji + ' ' + player.playerName}
+
+ {player.emoji + ' ' + player.playerName} +
= ({ gameState }) => layout transition={{ type: 'spring', stiffness: 100, damping: 20 }} > -
+
{(player.isAnswer ? player.emoji : 'πŸ‘»') + ' ' + player.playerName}
From 9453c4ddf758909a3d91597b50a093a8a2b16818 Mon Sep 17 00:00:00 2001 From: ijun17 Date: Tue, 24 Dec 2024 01:09:51 +0900 Subject: [PATCH 05/10] =?UTF-8?q?fix:=20=ED=80=B4=EC=A6=88=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=EC=A7=80=EA=B0=80=20=EA=B8=B8=EC=96=B4=EC=A7=88?= =?UTF-8?q?=EB=95=8C=20=EB=B0=95=EC=8A=A4=20=EB=B9=84=EC=9C=A8=EC=9D=B4=20?= =?UTF-8?q?=EB=8B=AC=EB=9D=BC=EC=A7=80=EB=8A=94=20=EB=B6=80=EB=B6=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/features/game/components/QuizOptionBoard.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FE/src/features/game/components/QuizOptionBoard.tsx b/FE/src/features/game/components/QuizOptionBoard.tsx index c6b6484f..0ff3e365 100644 --- a/FE/src/features/game/components/QuizOptionBoard.tsx +++ b/FE/src/features/game/components/QuizOptionBoard.tsx @@ -134,7 +134,7 @@ export const QuizOptionBoard = () => { {choiceListVisible && choiceList.map((option, i) => (
{ textShadow: '-1px 0 white, 0 1px white, 1px 0 white, 0 -1px white' }} > -
{option.content}
+
+ {option.content} +
))}
From af4c2745656c900622ecb6c5ff57404ff78d9c41 Mon Sep 17 00:00:00 2001 From: ijun17 Date: Tue, 24 Dec 2024 01:34:53 +0900 Subject: [PATCH 06/10] =?UTF-8?q?design:=20=EC=A0=95=EB=8B=B5=20=EB=B0=9C?= =?UTF-8?q?=ED=91=9C=20=EB=AA=A8=EB=8B=AC=20=EC=A0=95=EB=8B=B5=20=EC=97=AC?= =?UTF-8?q?=EB=B6=80=EB=A7=8C=20=EB=B3=B4=EC=97=AC=EC=A3=BC=EA=B2=8C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/game/components/AnswerModal.tsx | 37 +++++++------------ .../features/game/components/QuizHeader.tsx | 7 +--- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/FE/src/features/game/components/AnswerModal.tsx b/FE/src/features/game/components/AnswerModal.tsx index e716917f..6d73b1c3 100644 --- a/FE/src/features/game/components/AnswerModal.tsx +++ b/FE/src/features/game/components/AnswerModal.tsx @@ -1,18 +1,16 @@ -// import Lottie from 'lottie-react'; import lottie from 'lottie-web'; -// import AnswerBg from '@/assets/lottie/answer_background.json'; import AnswerBg from '@/assets/lottie/congrats.json'; import { useEffect, useState, useRef } from 'react'; -import { useQuizStore } from '../data/store/useQuizStore'; +import { usePlayerStore } from '../data/store/usePlayerStore'; type AnswerModalProps = { isOpen: boolean; - answer: number; }; -const AnswerModal: React.FC = ({ isOpen, answer }) => { +const AnswerModal: React.FC = ({ isOpen }) => { const [countdown, setCountdown] = useState(3); - const currentQuiz = useQuizStore((state) => state.currentQuiz); + const isAnswer = usePlayerStore((state) => state.players.get(state.currentPlayerId)?.isAnswer); + const isAlive = usePlayerStore((state) => state.players.get(state.currentPlayerId)?.isAlive); useEffect(() => { if (isOpen) { @@ -52,20 +50,10 @@ const AnswerModal: React.FC = ({ isOpen, answer }) => { } }, [isOpen]); - if (!isOpen || countdown <= 0) return null; + if (!isOpen || !isAlive || countdown <= 0) return null; return (
- {/* */} - { + {isAnswer && (
= ({ isOpen, answer }) => { minHeight: '100vh' }} /> - } + )} -
-

μ •λ‹΅ 곡개

-

- {currentQuiz?.choiceList.find((e) => e.order == answer)?.content} -

+
+ {isAnswer ? ( +

μ •λ‹΅μž…λ‹ˆλ‹€

+ ) : ( +

ν‹€λ ΈμŠ΅λ‹ˆλ‹€

+ )}
); diff --git a/FE/src/features/game/components/QuizHeader.tsx b/FE/src/features/game/components/QuizHeader.tsx index 283f3777..163700fd 100644 --- a/FE/src/features/game/components/QuizHeader.tsx +++ b/FE/src/features/game/components/QuizHeader.tsx @@ -12,7 +12,6 @@ export const QuizHeader = () => { const [seconds, setSeconds] = useState(0); const [isAnswerVisible, setIsAnswerVisible] = useState(false); const [limitTime, setLimitTime] = useState(0); - const answer = useQuizStore((state) => state.currentAnswer); useEffect(() => { if (currentQuiz) { setSeconds((currentQuiz.endTime - getServerTimestamp()) / 1000); @@ -71,11 +70,7 @@ export const QuizHeader = () => {
{'Q. ' + currentQuiz.quiz}
- setIsAnswerVisible(false)} - answer={answer} - /> +
); }; From 4e92307ff710d6a713661cbf5c35408001fd859f Mon Sep 17 00:00:00 2001 From: ijun17 Date: Tue, 24 Dec 2024 01:35:34 +0900 Subject: [PATCH 07/10] =?UTF-8?q?design:=20=EC=A0=95=EB=8B=B5=20=EB=B0=9C?= =?UTF-8?q?=ED=91=9C=20=EB=AA=A8=EB=8B=AC=20=EC=A3=BD=EC=97=88=EC=9D=84=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20"=EC=A0=95=EB=8B=B5=20=EB=B0=9C=ED=91=9C"?= =?UTF-8?q?=EB=9D=BC=EB=8A=94=20=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EB=9D=84?= =?UTF-8?q?=EC=9B=80=EC=9B=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/features/game/components/AnswerModal.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/FE/src/features/game/components/AnswerModal.tsx b/FE/src/features/game/components/AnswerModal.tsx index 6d73b1c3..b3a173cd 100644 --- a/FE/src/features/game/components/AnswerModal.tsx +++ b/FE/src/features/game/components/AnswerModal.tsx @@ -50,7 +50,7 @@ const AnswerModal: React.FC = ({ isOpen }) => { } }, [isOpen]); - if (!isOpen || !isAlive || countdown <= 0) return null; + if (!isOpen || countdown <= 0) return null; return (
{isAnswer && ( @@ -66,7 +66,9 @@ const AnswerModal: React.FC = ({ isOpen }) => { )}
- {isAnswer ? ( + {!isAlive ? ( +

μ •λ‹΅ λ°œν‘œ

+ ) : isAnswer ? (

μ •λ‹΅μž…λ‹ˆλ‹€

) : (

ν‹€λ ΈμŠ΅λ‹ˆλ‹€

From 77b03c68fa7d6f22c5c02854ffaa86d79c6709c8 Mon Sep 17 00:00:00 2001 From: ijun17 Date: Tue, 24 Dec 2024 01:41:22 +0900 Subject: [PATCH 08/10] =?UTF-8?q?design:=20=EC=B1=84=ED=8C=85=20"~?= =?UTF-8?q?=ED=99=98=EC=98=81=ED=95=A9=EB=8B=88=EB=8B=A4"=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80=20=EB=B3=80=EA=B2=BD=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/features/game/components/Chat.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/FE/src/features/game/components/Chat.tsx b/FE/src/features/game/components/Chat.tsx index 36ba253e..fe2bbd29 100644 --- a/FE/src/features/game/components/Chat.tsx +++ b/FE/src/features/game/components/Chat.tsx @@ -7,6 +7,7 @@ import { ReactElement, useEffect, useRef, useState } from 'react'; const Chat = () => { const gameId = useRoomStore((state) => state.gameId); const currentPlayerId = usePlayerStore((state) => state.currentPlayerId); + const currentPlayerName = usePlayerStore((state) => state.currentPlayerName); const messages = useChatStore((state) => state.messages); const [inputValue, setInputValue] = useState(''); const players = usePlayerStore((state) => state.players); @@ -128,8 +129,8 @@ const Chat = () => { onScroll={handleScroll} >
-
- πŸŽ‰ QuizGround에 μ˜€μ‹  것을 ν™˜μ˜ν•©λ‹ˆλ‹€ πŸŽ‰ +
+ πŸŽ‰ {currentPlayerName}λ‹˜ ν™˜μ˜ν•©λ‹ˆλ‹€ πŸŽ‰
{chatList} {myMessages.map((e, i) => ( From b9338f8839ec5249d7ac1edc8a791550b81e5c29 Mon Sep 17 00:00:00 2001 From: ijun17 Date: Tue, 24 Dec 2024 02:25:14 +0900 Subject: [PATCH 09/10] =?UTF-8?q?fix:=20=EC=BF=A0=ED=82=A4=EB=9F=B0=20?= =?UTF-8?q?=ED=8F=B0=ED=8A=B8=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 기쑴의 κ΅­λ―Όμ—°κΈˆ ν°νŠΈλŠ” μ„œλΈŒμ…‹μ΄μ—¬μ„œ 보이지 μ•ŠλŠ” κΈ€μžκ°€ μžˆμ—ˆμŒ(눜, 뷁) --- .../game/components/ParticipantDisplay.tsx | 13 +++---------- FE/src/index.css | 17 +++++------------ 2 files changed, 8 insertions(+), 22 deletions(-) diff --git a/FE/src/features/game/components/ParticipantDisplay.tsx b/FE/src/features/game/components/ParticipantDisplay.tsx index c99b1c2e..54765aef 100644 --- a/FE/src/features/game/components/ParticipantDisplay.tsx +++ b/FE/src/features/game/components/ParticipantDisplay.tsx @@ -34,9 +34,7 @@ const ParticipantDisplay: React.FC = ({ gameState }) => className="flex justify-between mt-2 pb-2 border-b border-default items-center" key={player.playerId} > -
- {player.emoji + ' ' + player.playerName}{' '} -
+
{player.emoji + ' ' + player.playerName}
{player.isHost && ( λ°©μž₯ πŸ‘‘ @@ -70,9 +68,7 @@ const ParticipantDisplay: React.FC = ({ gameState }) => layout transition={{ type: 'spring', stiffness: 100, damping: 20 }} > -
- {player.emoji + ' ' + player.playerName} -
+
{player.emoji + ' ' + player.playerName}
= ({ gameState }) => layout transition={{ type: 'spring', stiffness: 100, damping: 20 }} > -
+
{(player.isAnswer ? player.emoji : 'πŸ‘»') + ' ' + player.playerName}
diff --git a/FE/src/index.css b/FE/src/index.css index a85f1a78..ecde18aa 100644 --- a/FE/src/index.css +++ b/FE/src/index.css @@ -1,16 +1,9 @@ @import url('https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap'); -@font-face { - font-family: 'NPSfontBold'; - src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2310@1.0/NPSfontBold.woff2') - format('woff2'); - font-weight: 700; - font-style: bold; -} @font-face { - font-family: 'NPSfontBold'; - src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2310@1.0/NPSfontRegular.woff2') - format('woff2'); + font-family: 'CookieRun-Regular'; + src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/CookieRun-Regular.woff') + format('woff'); font-weight: 400; font-style: normal; } @@ -28,9 +21,9 @@ @layer base { html { - font-family: 'NPSfontBold', 'Noto Color Emoji', ui-sans-serif, system-ui; + font-family: 'CookieRun-Regular', 'Noto Color Emoji', ui-sans-serif, system-ui; box-sizing: border-box; - color: #5f6e76; + color: #687880; } *, *::before, From bad7250d992ffd2029d7b8a0489bcbbb6837637d Mon Sep 17 00:00:00 2001 From: ijun17 Date: Wed, 25 Dec 2024 13:16:17 +0900 Subject: [PATCH 10/10] =?UTF-8?q?style:=20socketListener=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=ED=8F=AC=EB=A7=B7=ED=8C=85=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FE/src/features/game/data/socketListener.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/FE/src/features/game/data/socketListener.ts b/FE/src/features/game/data/socketListener.ts index f3976a54..5ebc56a1 100644 --- a/FE/src/features/game/data/socketListener.ts +++ b/FE/src/features/game/data/socketListener.ts @@ -10,11 +10,11 @@ import { getEmojiByUUID } from '../utils/emoji'; // chat socketService.on('chatMessage', (data) => { - if(Array.isArray(data)){ - data.forEach((e)=>{ + if (Array.isArray(data)) { + data.forEach((e) => { useChatStore.getState().addMessage(e); - }) - }else{ + }); + } else { useChatStore.getState().addMessage(data); } }); @@ -40,11 +40,11 @@ socketService.on('joinRoom', (data) => { }); socketService.on('updatePosition', (data) => { - if(Array.isArray(data)){ - data.forEach((e)=>{ + if (Array.isArray(data)) { + data.forEach((e) => { usePlayerStore.getState().updatePlayerPosition(e.playerId, e.playerPosition); - }) - }else{ + }); + } else { usePlayerStore.getState().updatePlayerPosition(data.playerId, data.playerPosition); } });