Skip to content

Commit

Permalink
Fixes an issue where the room code was not set in storage
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathakurxd committed Mar 4, 2024
1 parent 73657be commit d603882
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/components/Conference.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const HOST_URL = 'wss://demo-yjs-server-production.up.railway.app'

function Conference() {
const peers = useHMSStore(selectPeers)
const roomCode = localStorage.getItem('roomCode') ?? ''
const roomCode = localStorage.getItem('roomCode')

const store = useYjsStore({
roomId: roomCode,
Expand Down
2 changes: 1 addition & 1 deletion app/components/JoinForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const JoinForm = () => {
// Type the event parameter
const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {
e.preventDefault()

if (roomCodeParam) {
try {
localStorage.setItem('roomCode', roomCodeParam)
Expand Down Expand Up @@ -58,6 +57,7 @@ const JoinForm = () => {
if (data.length >= 2) {
const roomCodeForStudent = data[0].code
const roomCodeForTeacher = data[1].code
localStorage.setItem('roomCode', roomCodeForTeacher)
const authToken = await hmsActions.getAuthTokenByRoomCode({
roomCode: activeTabRole === ROLES.TEACHER ? roomCodeForTeacher : roomCodeForStudent,
})
Expand Down

0 comments on commit d603882

Please sign in to comment.