UPDATE: Updated chat message structure;

Bug: Session seems to be empty when chat.py routes are called.
This commit is contained in:
Chris-1010
2025-01-30 17:57:38 +00:00
parent 5d3479e726
commit 3c0d9d3131
10 changed files with 52 additions and 37 deletions

View File

@@ -69,7 +69,7 @@ const LoginForm: React.FC<SubmitProps> = ({ onSubmit }) => {
if (data.logged_in) {
//TODO: Handle successful login (e.g., redirect to home page)
console.log("Login successful");
console.log("Login successful! Details: ", data);
setIsLoggedIn(true);
window.location.reload();
} else {

View File

@@ -25,7 +25,7 @@ const StreamerRoute: React.FC = () => {
checkStreamStatus();
// Poll for live status changes
const interval = setInterval(checkStreamStatus, 1000); // Check every 1 second
const interval = setInterval(checkStreamStatus, 10000); // Check every 10 second
return () => clearInterval(interval);
}, [streamerName]);

View File

@@ -4,7 +4,7 @@ import { useAuth } from "../../context/AuthContext";
import { useSocket } from "../../context/SocketContext";
interface ChatMessage {
chatter_id: string;
chatter_username: string;
message: string;
time_sent: string;
}
@@ -112,11 +112,11 @@ const ChatPanel: React.FC<ChatPanelProps> = ({ streamId }) => {
</span>
<span
className={`font-bold ${
msg.chatter_id === username ? "text-blue-400" : "text-green-400"
msg.chatter_username === username ? "text-blue-400" : "text-green-400"
}`}
>
{" "}
{msg.chatter_id}:{" "}
{msg.chatter_username}:{" "}
</span>
<span>{msg.message}</span>
</div>