From 1656ff1b0a57b55a48b03a5752d46c56c47f0947 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:07:20 -0300 Subject: [PATCH] fix: subscription check --- .../upload-background-image-button.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/renderer/src/pages/profile/upload-background-image-button/upload-background-image-button.tsx b/src/renderer/src/pages/profile/upload-background-image-button/upload-background-image-button.tsx index e154363bf..d3ca35bb7 100644 --- a/src/renderer/src/pages/profile/upload-background-image-button/upload-background-image-button.tsx +++ b/src/renderer/src/pages/profile/upload-background-image-button/upload-background-image-button.tsx @@ -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"); @@ -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 (