diff --git a/src/components/AdminPage.tsx b/src/components/AdminPage.tsx index 8dadee9..8f311be 100644 --- a/src/components/AdminPage.tsx +++ b/src/components/AdminPage.tsx @@ -11,9 +11,13 @@ export const AdminPage = ({ roomId }: { roomId: string }) => { useEffect(() => { const url = new URL(location.href) - setPassword(url.searchParams.get('password')) - url.searchParams.delete('password') - history.replaceState({}, '', url.toString()) + if (url.searchParams.has('password')) { + setPassword(url.searchParams.get('password')) + + // remove password from url + url.searchParams.delete('password') + history.replaceState({}, '', url.toString()) + } }, []) const listeners = useRef void>>({})