Loading...
@@ -71,13 +111,24 @@ const CategoryPage: React.FC = () => {
+ >
+ {isLoggedIn && (
+
+ )}
+
{streams.length === 0 && !isLoading && (
diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx
index 5084bd2..eca2b0f 100644
--- a/frontend/src/pages/HomePage.tsx
+++ b/frontend/src/pages/HomePage.tsx
@@ -1,4 +1,4 @@
-import React from "react";
+import React, { useRef, useEffect } from "react";
import ListRow from "../components/Layout/ListRow";
import { useNavigate } from "react-router-dom";
import { useStreams, useCategories } from "../context/ContentContext";
@@ -22,13 +22,16 @@ const HomePage: React.FC
= ({ variant = "default" }) => {
navigate(`/category/${categoryName}`);
};
+ if (!categories || categories.length === 0) {
+ return Loading categories...
;
+ }
+
return (
- {/* If Personalised_HomePage, display Streams recommended for the logged-in user. Else, live streams with the most viewers. */}
= ({ variant = "default" }) => {
wrap={false}
onClick={handleStreamClick}
extraClasses="bg-[var(--liveNow)]"
- >
- {/* */}
-
+ />
{/* If Personalised_HomePage, display Categories the logged-in user follows. Else, trending categories. */}
= ({ variant = "default" }) => {
);
};
-export default HomePage;
+export default HomePage;
\ No newline at end of file