Skip to content

Commit

Permalink
fix: subscription check
Browse files Browse the repository at this point in the history
  • Loading branch information
zamitto committed Oct 22, 2024
1 parent b54cfba commit 1656ff1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
export function UploadBackgroundImageButton() {
const [isUploadingBackgroundImage, setIsUploadingBackgorundImage] =
useState(false);
const { userDetails } = useUserDetails();
const { hasActiveSubscription } = useUserDetails();

const { t } = useTranslation("user_profile");

Expand Down Expand Up @@ -47,8 +47,7 @@ export function UploadBackgroundImageButton() {
}
};

if (!isMe || !userDetails?.subscription) return null;
if (userDetails.subscription.plan.name !== "plus") return null;
if (!isMe || !hasActiveSubscription) return null;

return (
<Button
Expand Down

0 comments on commit 1656ff1

Please sign in to comment.