diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 217fc2209..f3b7073b1 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -17,6 +17,7 @@ import { isSubscribed, SetConfirmAction, SetDialogMessage, + hasStripeSubscription, } from 'utils/billingUtil'; import exportService from 'services/exportService'; @@ -81,7 +82,18 @@ export default function Sidebar(props: Props) { } const router = useRouter(); - + function onManageClick() { + if (hasStripeSubscription(subscription)) { + setIsOpen(false); + props.setPlanModalView(true); + } else { + props.setDialogMessage({ + title: constants.ERROR, + content: constants.SUBSCRIPTION_MANAGEMENT_NOT_POSSIBLE, + close: { variant: 'danger' }, + }); + } + } return ( { - setIsOpen(false); - props.setPlanModalView(true); - }} + onClick={onManageClick} > {isSubscribed(subscription) ? constants.MANAGE