PATCH: Fixed database not returning data in recommendations
UPDATE: Decreased polling time to 1 second for later use
This commit is contained in:
@@ -25,7 +25,7 @@ const StreamerRoute: React.FC = () => {
|
||||
checkStreamStatus();
|
||||
|
||||
// Poll for live status changes
|
||||
const interval = setInterval(checkStreamStatus, 20000); // Check every 20 seconds
|
||||
const interval = setInterval(checkStreamStatus, 1000); // Check every 1 second
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, [streamerName]);
|
||||
|
||||
@@ -3,6 +3,7 @@ import Navbar from "../components/Layout/Navbar";
|
||||
import ListRow from "../components/Layout/ListRow";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useStreams } from "../context/StreamsContext";
|
||||
import { useAuth } from "../context/AuthContext";
|
||||
|
||||
interface HomePageProps {
|
||||
variant?: "default" | "personalised";
|
||||
@@ -11,6 +12,7 @@ interface HomePageProps {
|
||||
const HomePage: React.FC<HomePageProps> = ({ variant = "default" }) => {
|
||||
const { featuredStreams, featuredCategories } = useStreams();
|
||||
const navigate = useNavigate();
|
||||
const { isLoggedIn } = useAuth();
|
||||
|
||||
const handleStreamClick = (streamId: number, streamerName: string) => {
|
||||
console.log(`Navigating to ${streamId}`);
|
||||
@@ -25,13 +27,25 @@ const HomePage: React.FC<HomePageProps> = ({ variant = "default" }) => {
|
||||
>
|
||||
<Navbar variant="home" />
|
||||
|
||||
|
||||
{/* Not working - trying to display default streams */}
|
||||
<ListRow
|
||||
type="stream"
|
||||
title={"Live Now" + (variant === "personalised" ? " - Recommended" : "")}
|
||||
description={variant === "personalised" ? "We think you might like these streams - Streamers recommended for you" : "Streamers that are currently live"}
|
||||
title="Live Now"
|
||||
description="Streamers that are currently live"
|
||||
items={featuredStreams}
|
||||
onClick={handleStreamClick}
|
||||
/>
|
||||
|
||||
{isLoggedIn && variant === "personalised" && (
|
||||
<ListRow
|
||||
type="stream"
|
||||
title="Live Now - Recommended"
|
||||
description="We think you might like these streams - Streamers recommended for you"
|
||||
items={featuredStreams}
|
||||
onClick={handleStreamClick}
|
||||
/>
|
||||
)}
|
||||
<ListRow
|
||||
type="category"
|
||||
title={variant === "personalised" ? "Followed Categories" : "Trending Categories"}
|
||||
|
||||
Reference in New Issue
Block a user