Skip to content

Commit

Permalink
Add routing to collab room
Browse files Browse the repository at this point in the history
  • Loading branch information
dylkaw committed Oct 31, 2024
1 parent 392d1ab commit 4b8b23e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions frontend/components/collab/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ export default function Chat() {
const lastMessageRef = useRef<HTMLDivElement | null>(null);

useEffect(() => {
scrollToBottom();
if (partnerMessages.length > 0 || aiMessages.length > 0) {
scrollToBottom();
}
}, [partnerMessages, aiMessages]);

useEffect(() => {
scrollToBottom();
}, [chatTarget]);

const scrollToBottom = () => {
if (lastMessageRef.current) {
lastMessageRef.current.scrollIntoView({ behavior: "smooth" });
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/matching/find-match.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function FindMatch() {
description: "Successfully matched",
variant: "success",
});
router.push(`/collaboration/${roomId}`);
router.push(`collab/${roomId}`);
} else {
toast({
title: "Error",
Expand Down Expand Up @@ -148,7 +148,7 @@ export default function FindMatch() {
description: "Successfully matched",
variant: "success",
});
router.push(`/collaboration/${roomId}`);
router.push(`collab/${roomId}`);
} else {
toast({
title: "Error",
Expand Down

0 comments on commit 4b8b23e

Please sign in to comment.