Skip to content

Commit

Permalink
separate useEfect for viewerCode param
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentFlameCR committed Dec 12, 2023
1 parent f957666 commit 705a048
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/javascript/components/rooms/room/join/JoinCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ export default function JoinCard() {
} else if (currentUser?.name) {
methods.setValue('name', currentUser.name);
}
}, [joinFormName, currentUser?.name]);

// Default viewerCode if passed as query params
useEffect(() => {
// Default viewerCode if passed as query param
if (viewerCode) {
methods.setValue('access_code', viewerCode);
}
}, [viewerCode, joinFormName, currentUser?.name]);
}, [viewerCode]);

useEffect(() => {
// Room channel subscription:
Expand Down

0 comments on commit 705a048

Please sign in to comment.