Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions backend/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ io.on("connection", (socket) => {
console.log(`🟢 User connected: ${socket.id}`);

// ---------------- Join Room ----------------
socket.on("join-room", async (roomId: string, userName: string) => {
try {
socket.join(roomId);
console.log(`👥 ${userName} joined room ${roomId}`);
socket.on("join-room", async ({ roomId, userName }: { roomId: string; userName: string }) => {
try {
socket.join(roomId);
console.log(`👥 ${userName} joined room ${roomId}`);

// Notify others
io.to(roomId).emit("user-joined", { userName, roomId });
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import InRoom from "./pages/InRoom.js";
import CreateRoomLobby from "./pages/CreateRoomLobby.js";
import CreateRoom from "./pages/CreateRoom.js";
import ActiveSessions from "./pages/ActiveSessions.js";
import InRoomWrapper from "./pages/InRoomWrapper.js";
const queryClient = new QueryClient();

const App = () => (
Expand All @@ -32,7 +33,7 @@ const App = () => (
<Route path="/oauth-success" element={<OAuthSuccess />} />
<Route path="/create-room" element={<CreateRoom />} /> {/* ✅ */}
<Route path="/join-room" element={<JoinRoom />} /> {/* ✅ */}
<Route path="/room/:roomName" element={<InRoom />} />
<Route path="/room/:roomName" element={<InRoomWrapper />} />
<Route path="/lobby/:roomId" element={<CreateRoomLobby />} />
<Route path="/sessions" element={<ActiveSessions />} />
</Routes>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/CreateRoomLobby.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function CreateRoomLobby() {
}
};
fetchRoom();
}, [roomId]);
}, [roomId,roomName]);

// Copy join link to clipboard
const handleCopyLink = () => {
Expand Down Expand Up @@ -73,7 +73,7 @@ export default function CreateRoomLobby() {
</p>

<Button
onClick={() => navigate(`/room/${roomId}`)}
onClick={() => navigate(`/room/${roomName}`)}
className="mt-6 w-full bg-green-600 hover:bg-green-700 text-white font-medium py-3 rounded-lg shadow-md"
>
Go to Room
Expand Down
Loading
Loading