-
Notifications
You must be signed in to change notification settings - Fork 0
Dannguyen/same room dialog #587
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
base: main
Are you sure you want to change the base?
Conversation
| </div> | ||
| <h2 className="font-medium"> | ||
| Code<span className="text-codebuddy-pink">Buddy</span> | ||
| Code<span className="text-codebuddy-pink">Buddy2</span> |
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.
note to revert
| if (room && Object.keys(room.users).includes(username)) { | ||
| console.log(`User ${username} is already in room ${id}`); | ||
| set((state) => { | ||
| state.status = RoomStatus.IN_ROOM; |
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.
Do we want to set state here?
| }); | ||
| } | ||
| }, | ||
| checkAlreadyInRoom: async (id: string) => { |
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.
RoomController already does a fetch https://github.com/nickbar01234/codebuddy/blob/main/extension/src/services/controllers/RoomController.ts#L284-L305. Probably can just extend from it?
| const username = appStore | ||
| .getState() | ||
| .actions.getAuthUser().username; | ||
| const room = await db.room.get(id); |
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.
You mentioned dialog never popped up. Did you print username / room object here?
| }, [join]); | ||
| }, [join, checkAlreadyInRoom]); | ||
|
|
||
| const onJoinAnyway = React.useMemo(() => { |
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.
Update onJoinRoom to take a parameter on whether to validate if user is already in room or not
Description
Screenshots
Test
Checklist
If you're making changes to the extension, please run through the following checklist to make sure that we don't have
any regressions. Note that we plan to add integration tests in the future!
Possible Downsides
Additional Documentations