Skip to content

Commit

Permalink
Merge pull request #54055 from Shahidullah-Muffakir/fix/53382
Browse files Browse the repository at this point in the history
Skip auto-renew survey for users with no billing history when disabling auto-renew in the Subscription settings
  • Loading branch information
techievivek authored Dec 13, 2024
2 parents c30420c + 8931dbd commit 31ad7c7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 = () => {
Expand Down

0 comments on commit 31ad7c7

Please sign in to comment.