Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gagahgk committed Feb 7, 2024
2 parents d607abf + bcc3335 commit 27570dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions app/_features/room/components/conference-lobby.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function ConferenceLobby({ roomID }: LobbyProps) {
[]
);

const { clientName } = useClientContext();
const { clientID, clientName } = useClientContext();

const openUpdateClientForm = useCallback(() => {
document.dispatchEvent(new CustomEvent('open:set-display-name-modal'));
Expand Down Expand Up @@ -187,6 +187,8 @@ export default function ConferenceLobby({ roomID }: LobbyProps) {
}
}, [videoConstraints, audioConstraints, roomID, isSubmitting]);

const isError = !clientID || !clientName;

return (
<>
<SetDisplayNameModal roomID={roomID} />
Expand Down Expand Up @@ -294,9 +296,9 @@ export default function ConferenceLobby({ roomID }: LobbyProps) {
<Button
className="w-full rounded-lg bg-red-700 px-4 py-2 font-semibold text-zinc-200 antialiased hover:bg-red-600 active:bg-red-500"
onClick={openConferenceRoom}
isDisabled={isSubmitting}
aria-disabled={isSubmitting}
disabled={isSubmitting}
isDisabled={isSubmitting || isError}
aria-disabled={isSubmitting || isError}
disabled={isSubmitting || isError}
>
{isSubmitting ? (
<div className="flex gap-2">
Expand Down
4 changes: 2 additions & 2 deletions app/_shared/middlewares/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const registerClient = async (roomID: string, clientName: string) => {
const data = response.data || {};

const client: ClientType.ClientData = {
clientID: data.clientID,
clientName: data.name,
clientID: data.clientID || '',
clientName: data.name || clientName,
};

return client;
Expand Down

0 comments on commit 27570dd

Please sign in to comment.