-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed the functionality of START_GAME Event #172
Fixed the functionality of START_GAME Event #172
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Triggering Sync_State Event after Start_Game and draw_card event as these events make changes using backend functions These changes require to synced just after the event is triggered In preperation of shivansh-bhatnagar18#169
daf9f01
to
de335ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some suggestions. Looks good mostly, haven't tested menually
useEffect(() => { | ||
modal.show(<GamePropertiesModal />, 'large', [], false); | ||
// eslint-disable-next-line | ||
}, []); // todo add the required dependencies | ||
}, [gameState.players.length, gameState.id]); // todo add the required dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including id here is necessary as previously explained. As long as the Game component is mounted, the game's id wont change.
This change will cause a UX inconvenience as previously mentioned, but we can ignore that for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this , for joining players game id is not visible on the modal , so i included it , for now, i guess, we can keep it like this and fix this in upcoming prs.
frontend/src/pages/Game.tsx
Outdated
@@ -78,10 +80,11 @@ function Game() { | |||
const shuffledCards = [...cards].sort(() => Math.random() - 0.5); | |||
return shuffledCards.slice(0, 7); | |||
}, []); | |||
console.log(gameState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this
Added handler for StartGame at frontend and made some minor corrections Fixes : shivansh-bhatnagar18#169
de335ed
to
37b9e27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good
Description
Added handler for StartGame at frontend and made some minor corrections. Also Triggered Sync_State Event after Start_Game and draw_card event as these events make changes using backend functions.
These changes require to synced just after the event is triggered
Fixes : #169
Checklist
Screenshots (if applicable)
[If your changes include any visual updates, provide screenshots here.]