Skip to content

Commit

Permalink
Merge pull request #88 from our-mini-games/feat-Chinese-chess
Browse files Browse the repository at this point in the history
fix: 更新用户初次进入房间时获取信息的时机
  • Loading branch information
humandetail authored Jan 2, 2024
2 parents ec3fc12 + 311631c commit 7203a41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/Chinese-chess/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@ant-design/icons-vue": "^6.1.0",
"@vitejs/plugin-vue": "^4.5.2",
"ant-design-vue": "^3.2.15",
"chinese-chess-service": "^0.0.21",
"chinese-chess-service": "^0.0.23",
"lodash.clonedeep": "^4.5.0",
"socket.io-client": "^4.7.2",
"vue": "^3.2.41"
Expand Down
3 changes: 2 additions & 1 deletion packages/Chinese-chess/src/pages/OnlineGame/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const socketHandler = (socket: Socket) => {
})
// 用户加入房间
socket.on(events.room.join, (user) => {
socket.on(events.room.join, (user, data) => {
currentUser.value = user
localStorage.setItem(USER_INFO_KEY, JSON.stringify(user))
Expand All @@ -85,6 +85,7 @@ const socketHandler = (socket: Socket) => {
throw new Error('程序出错,房间不存在', user.roomId)
}
currentRoom.value = room
context.value = data
})
// 用户离开房间
socket.on(events.room.leave, user => {
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7203a41

Please sign in to comment.