|
|
@@ -4,7 +4,6 @@ import { useSubscriptionDashboardContext } from '../../../../context/subscriptio
|
|
|
import OLButton from '@/shared/components/ol/ol-button'
|
|
|
import { PaidSubscription } from '../../../../../../../../types/subscription/dashboard/subscription'
|
|
|
import { useFeatureFlag } from '@/shared/context/split-test-context'
|
|
|
-import { useLocation } from '@/shared/hooks/use-location'
|
|
|
|
|
|
export function CancelSubscriptionButton() {
|
|
|
const { t } = useTranslation()
|
|
|
@@ -14,7 +13,6 @@ export function CancelSubscriptionButton() {
|
|
|
setModalIdShown,
|
|
|
setShowCancellation,
|
|
|
} = useSubscriptionDashboardContext()
|
|
|
- const location = useLocation()
|
|
|
|
|
|
const subscription = personalSubscription as PaidSubscription
|
|
|
const isInTrial =
|
|
|
@@ -31,18 +29,13 @@ export function CancelSubscriptionButton() {
|
|
|
useFeatureFlag('pause-subscription') &&
|
|
|
!hasPendingOrActivePause &&
|
|
|
planIsEligibleForPause
|
|
|
- const shouldContactSupport =
|
|
|
- subscription.payment.state === 'paused' &&
|
|
|
- subscription.payment.remainingPauseCycles === 0
|
|
|
|
|
|
function handleCancelSubscriptionClick() {
|
|
|
eventTracking.sendMB('subscription-page-cancel-button-click', {
|
|
|
plan_code: subscription?.planCode,
|
|
|
is_trial: isInTrial,
|
|
|
})
|
|
|
- if (shouldContactSupport) {
|
|
|
- location.assign('/contact')
|
|
|
- } else if (enablePause) {
|
|
|
+ if (enablePause) {
|
|
|
setModalIdShown('pause-subscription')
|
|
|
} else {
|
|
|
setShowCancellation(true)
|