Skip to content

Commit

Permalink
fix: minor typo bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shubho0908 committed Jun 23, 2024
1 parent 46829af commit b0deb29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions frontend/src/Components/Subscriptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import "react-loading-skeleton/dist/skeleton.css";
import { useSelector } from "react-redux";

function Subscriptions() {
const backendURL = "https://youtube-clone-mern-backend.vercel.app"
const backendURL = "https://youtube-clone-mern-backend.vercel.app";
// const backendURL = "http://localhost:3000";
const [subscriptions, setSubscriptions] = useState([]);
const [subsVideos, setSubsVideos] = useState([]);
Expand Down Expand Up @@ -41,14 +41,18 @@ function Subscriptions() {
useEffect(() => {
const getSubscriptions = async () => {
try {
const response = await fetch(`${backendURL}/getsubscriptions/${user?.email}`);
const result = await response.json();
setSubscriptions(result);
if (user?.email) {
const response = await fetch(
`${backendURL}/getsubscriptions/${user?.email}`
);
const result = await response.json();
setSubscriptions(result);
}
} catch (error) {
// console.log(error.message);
}
};
return () => getSubscriptions();
getSubscriptions();
}, [user?.email]);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/Trending.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Trending() {
useEffect(() => {
setTimeout(() => {
setLoading(false);
}, 3200);
}, 1000);
}, []);

useEffect(() => {
Expand Down

0 comments on commit b0deb29

Please sign in to comment.