diff --git a/src/pages/settings/Subscription/SubscriptionSettings/index.tsx b/src/pages/settings/Subscription/SubscriptionSettings/index.tsx index 3af05e1ef1cd..a624244bafeb 100644 --- a/src/pages/settings/Subscription/SubscriptionSettings/index.tsx +++ b/src/pages/settings/Subscription/SubscriptionSettings/index.tsx @@ -24,10 +24,11 @@ function SubscriptionSettings() { const {translate} = useLocalize(); const styles = useThemeStyles(); const theme = useTheme(); + const [account] = useOnyx(ONYXKEYS.ACCOUNT); const [privateSubscription] = useOnyx(ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION); const preferredCurrency = usePreferredCurrency(); const possibleCostSavings = useSubscriptionPossibleCostSavings(); - const [isActingAsDelegate] = useOnyx(ONYXKEYS.ACCOUNT, {selector: (account) => account?.delegatedAccess?.delegate}); + const isActingAsDelegate = !!account?.delegatedAccess?.delegate; const [isNoDelegateAccessMenuVisible, setIsNoDelegateAccessMenuVisible] = useState(false); const autoRenewalDate = formatSubscriptionEndDate(privateSubscription?.endDate); @@ -41,7 +42,11 @@ function SubscriptionSettings() { Subscription.updateSubscriptionAutoRenew(true); return; } - Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_DISABLE_AUTO_RENEW_SURVEY); + if (account?.hasPurchases) { + Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_DISABLE_AUTO_RENEW_SURVEY); + } else { + Subscription.updateSubscriptionAutoRenew(false); + } }; const handleAutoIncreaseToggle = () => {