diff --git a/apps/OpenSign/src/components/BulkSendUi.js b/apps/OpenSign/src/components/BulkSendUi.js index f04130cbf..c71ab35ed 100644 --- a/apps/OpenSign/src/components/BulkSendUi.js +++ b/apps/OpenSign/src/components/BulkSendUi.js @@ -6,8 +6,11 @@ import { useTranslation } from "react-i18next"; import Parse from "parse"; import ModalUi from "../primitives/ModalUi"; import { isEnableSubscription } from "../constant/const"; +import { fetchSubscription } from "../constant/Utils"; +import { useNavigate } from "react-router-dom"; const BulkSendUi = (props) => { const { t } = useTranslation(); + const navigate = useNavigate(); const [forms, setForms] = useState([]); const [formId, setFormId] = useState(2); const formRef = useRef(null); @@ -25,6 +28,7 @@ const BulkSendUi = (props) => { }); const [isQuotaReached, setIsQuotaReached] = useState(false); const [isLoader, setIsLoader] = useState(false); + const [isFreePlan, setIsFreePlan] = useState(false); const allowedSigners = 50; useEffect(() => { signatureExist(); @@ -36,6 +40,10 @@ const BulkSendUi = (props) => { if (isEnableSubscription) { setIsLoader(true); try { + const subscription = await fetchSubscription(); + if (subscription?.plan === "freeplan") { + setIsFreePlan(true); + } const allowedquicksend = await Parse.Cloud.run("allowedquicksend"); if (allowedquicksend > 0) { setIsBulkAvailable(true); @@ -273,6 +281,9 @@ const BulkSendUi = (props) => { const handleCloseQuotaReached = () => { setIsQuotaReached(false); }; + const handleNavigation = () => { + navigate("/subscription"); + }; return ( <> {isLoader ? ( @@ -385,46 +396,62 @@ const BulkSendUi = (props) => { )} > ) : ( -