diff --git a/src/views/Chores/MyChores.jsx b/src/views/Chores/MyChores.jsx index 71d9f4e..2af0457 100644 --- a/src/views/Chores/MyChores.jsx +++ b/src/views/Chores/MyChores.jsx @@ -92,9 +92,15 @@ const MyChores = () => { const { data: choresData, isLoading: choresLoading, + isError: choresError, + error: choresErrorDetails, refetch: refetchChores, } = useChores(false) - const { data: membersData, isLoading: membersLoading } = useCircleMembers() + const { + data: membersData, + isLoading: membersLoading, + isError: membersError, + } = useCircleMembers() const [chores, setChores] = useState([]) const [filteredChores, setFilteredChores] = useState([]) @@ -750,6 +756,48 @@ const MyChores = () => { setSearchFilter('All') } + // Show error state when API is unreachable + if (choresError || membersError) { + return ( + + + + + + + Unable to communicate with server + + + {choresErrorDetails?.message || + 'The server is currently unavailable. Please check your connection and try again.'} + + + + + ) + } + if ( isUserProfileLoading || userProfile === null ||