Skip to content

Commit

Permalink
Merge pull request #33 from SohamRatnaparkhi/bugs/meeting
Browse files Browse the repository at this point in the history
Bugs/meeting
  • Loading branch information
Soham1803 authored Oct 7, 2023
2 parents d326d44 + 2291b41 commit cc37648
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 41 deletions.
2 changes: 1 addition & 1 deletion frontend/app/api/meetings/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function createMeeting(request) {
description: meetDescription,
muteOnEntry: muteOnEntry,
videoOnEntry: disableVideo,
roomLocked: true,
roomLocked: false,
}),
headers: {
'Content-Type': 'application/json',
Expand Down
17 changes: 12 additions & 5 deletions frontend/app/meeting/lobby/[slug]/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MeetLobby = ({ params }) => {
const [isPeerHost, setIsPeerHost] = React.useState(false);

const { initialize, me } = useHuddle01();
const { isRoomJoined } = useRoom();
const { isRoomJoined, error } = useRoom();
const { peers } = usePeers();
const { joinLobby, leaveLobby, isLoading, isLobbyJoined } = useLobby();
const [accessDenied, setAccessDenied] = React.useState(false);
Expand All @@ -48,7 +48,7 @@ const MeetLobby = ({ params }) => {
const {
fetchVideoStream,
stopVideoStream,
error,
// error,
} = useVideo();
const { joinRoom } = useRoom();
// const { setDisplayName } = useAppUtils();
Expand Down Expand Up @@ -87,6 +87,8 @@ const MeetLobby = ({ params }) => {
}
}

console.log(error)

const checkLobbyConditions = async () => {
var { address } = await getWalletDetails();
setMyEthAddress(address);
Expand Down Expand Up @@ -149,15 +151,19 @@ const MeetLobby = ({ params }) => {
if (isRoomJoined) {
push(`/meeting/room/${params.slug}`);
}
console.log(isRoomJoined)
console.log("abcd")
}, [isRoomJoined]);



console.log(isRoomJoined)
const handleMeetStart = () => {
console.log("is lobby joined", isLobbyJoined)
if (!isLobbyJoined) return;
// if (!isLobbyJoined) return;
setMyPeerId(me.meId);
console.log("joining room")
joinRoom();
console.log("joining room done")
}

if (isLoading) return (<div><iframe src="https://lottie.host/?file=307fb28b-48a0-477a-8c49-a9ba66f14a79/clHpsh7QES.json"></iframe></div>)
Expand All @@ -167,6 +173,7 @@ const MeetLobby = ({ params }) => {
<Navbar />
{/* {isLobbyJoined}
{JSON.stringify(peers)} */}
{isRoomJoined}
<h2 className="text-3xl font-bold m-5">READY TO JOIN?</h2>

<div className='flex flex-col items-center bg-[#5D8BF436] h-3/5 w-1/2 rounded-[20px]'>
Expand Down Expand Up @@ -281,7 +288,7 @@ const MeetLobby = ({ params }) => {
}}

>
{`JOIN MEET`}
{`JOIN MEET ${joinRoom.isCallable}`}
</Button>
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions frontend/app/meeting/room/[slug]/components/ChatBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ const ChatBox = ({ chatBox, peers }) => {
}
};

console.log(roomMessages)

return (
<div className={cn(chatBox ? "w-25%" : "0", "ease-in-out duration-300")}>
{chatBox && (
Expand Down Expand Up @@ -190,7 +192,7 @@ const ChatBox = ({ chatBox, peers }) => {
);
})}
</div>

{/* Individual messages */}
<div
className={cn(
Expand All @@ -213,7 +215,7 @@ const ChatBox = ({ chatBox, peers }) => {
{
roomMessages.filter(
(message) =>
message.sender?.meId == talkTo || message.receiver == talkTo
message.sender?.meId == talkTo || message.receiver == talkTo || message.receivers?.includes(talkTo)
).length > 0
? roomMessages
.filter(
Expand Down Expand Up @@ -358,13 +360,15 @@ const ChatBox = ({ chatBox, peers }) => {
message: groupMessage,
kind: "private",
receiver: peerId,
receivers: peerIdsToSend,
timeStamp: formatTime(new Date().getTime()),
});
addRoomMessage([peerId], {
addRoomMessage({
sender: me,
message: groupMessage,
kind: "private",
receiver: peerId,
receivers: peerIdsToSend,
timeStamp: formatTime(new Date().getTime()),
});
console.log(
Expand Down
68 changes: 38 additions & 30 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@fontsource/roboto": "^5.0.8",
"@huddle01/react": "^0.0.13",
"@huddle01/react": "^0.0.16",
"@mui/icons-material": "^5.14.9",
"@mui/material": "^5.14.10",
"@prisma/client": "^5.2.0",
Expand All @@ -34,7 +34,6 @@
"react-icons": "^4.11.0",
"react-speech-recognition": "^3.10.0",
"regenerator-runtime": "^0.14.0",
"react-icons": "^4.11.0",
"tailwindcss": "3.3.3",
"zustand": "^4.4.1"
},
Expand Down

0 comments on commit cc37648

Please sign in to comment.