Skip to content
Snippets Groups Projects
Unverified Commit 74d40f52 authored by Rahul Rodrigues's avatar Rahul Rodrigues Committed by GitHub
Browse files

access_code on joinCard autofill if viewerCode query param passed (#5610)

* viewerCode query param if passed autofills access_code on joinCard

* fixed eslint space error

* separate useEfect for viewerCode param
parent 7422a461
Branches
No related tags found
No related merge requests found
......@@ -65,6 +65,7 @@ export default function JoinCard() {
const location = useLocation();
const queryParams = new URLSearchParams(location.search);
const joinFormName = queryParams.get('joinFormName');
const viewerCode = queryParams.get('viewerCode');
useEffect(() => { // set cookie to return to if needed
const date = new Date();
......@@ -98,6 +99,13 @@ export default function JoinCard() {
}
}, [joinFormName, currentUser?.name]);
useEffect(() => {
// Default viewerCode if passed as query param
if (viewerCode) {
methods.setValue('access_code', viewerCode);
}
}, [viewerCode]);
useEffect(() => {
// Room channel subscription:
if (roomStatusAPI.isSuccess) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment