Skip to content

Commit

Permalink
Add null check to ProfileCard component
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsingh132 committed Jul 8, 2024
1 parent 71ec6c4 commit 7bbaf58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions components/ProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { Button } from "./ui/button";
import { useIsSubscribed, useGetPlan } from "@/hooks/useIsSubscribed";

type planDetails = {
subscriptionId: string;
endsOn: number;
plan: string;
};
subscriptionId: string | null;
endsOn: number | null;
plan: string | null;
} | null;

const ProfileCard = ({
podcastData,
Expand All @@ -32,7 +32,8 @@ const ProfileCard = ({
};

const isSubscribed = useIsSubscribed(profileId);
const { plan } = useGetPlan(profileId) as planDetails;
const planDetails = useGetPlan(profileId) as planDetails;
const { plan } = planDetails || {};

useEffect(() => {
if (randomPodcast) {
Expand Down
6 changes: 3 additions & 3 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
typescript: {
ignoreBuildErrors: true,
},
// typescript: {
// ignoreBuildErrors: true,
// },
images: {
remotePatterns: [
{
Expand Down

0 comments on commit 7bbaf58

Please sign in to comment.