From 8f1a7b45f205df8255483659cd8cf86ecb9481c8 Mon Sep 17 00:00:00 2001 From: josetano2 Date: Fri, 23 Aug 2024 12:26:12 +0700 Subject: [PATCH] feat: bug fix --- src/ss_frontend/src/components/HomePost.jsx | 10 +++++----- src/ss_frontend/src/pages/PeoplePage.jsx | 9 +++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/ss_frontend/src/components/HomePost.jsx b/src/ss_frontend/src/components/HomePost.jsx index f7c4617..a715c67 100644 --- a/src/ss_frontend/src/components/HomePost.jsx +++ b/src/ss_frontend/src/components/HomePost.jsx @@ -75,7 +75,7 @@ const HomePost = ({ post, choosePost, refetch }) => {

{name}

{post.description}

- {post.images.length != 0 && ( + {post && post.images && post.images.length != 0 && (
{post.images.map((imageUrl) => { return ( @@ -98,18 +98,18 @@ const HomePost = ({ post, choosePost, refetch }) => {
{liked == true ? <> -

{post.likes.length}

+

{post && post.likes && post.likes.length}

: <> -

{post.likes.length}

} +

{post && post.likes && post.likes.length}

}
-

{post.comments.length}

+

{post && post.comments && post.comments.length}

-

{post.investors.length}

+

{post && post.investors && post.investors.length}

{ diff --git a/src/ss_frontend/src/pages/PeoplePage.jsx b/src/ss_frontend/src/pages/PeoplePage.jsx index 6297412..9599d4e 100644 --- a/src/ss_frontend/src/pages/PeoplePage.jsx +++ b/src/ss_frontend/src/pages/PeoplePage.jsx @@ -1,14 +1,11 @@ import React, { useState, useEffect } from "react"; -import { useQuery, QueryClient, QueryClientProvider } from "react-query"; +import { useQuery } from "react-query"; import MainTemplate from "../templates/MainTemplate"; import profile_1 from "../assets/about/theo.jpg"; import profile_2 from "../assets/about/ryan.jpg"; import People from "../components/People"; import { ss_backend } from "../../../declarations/ss_backend"; -// Create a QueryClient instance -const queryClient = new QueryClient(); - const PeoplePage = () => { const [people, setPeople] = useState(); const { isLoading, error, isFetching } = useQuery({ @@ -42,10 +39,10 @@ const PeoplePage = () => { return (
- {isLoading || isFetching ? <> : people} + {/* {isLoading || isFetching ? <> : people} */}
); }; -export default PeoplePage; \ No newline at end of file +export default PeoplePage;