Skip to content

Commit

Permalink
Set minimum amount to always be the recommended budget.
Browse files Browse the repository at this point in the history
  • Loading branch information
asvinb committed Oct 7, 2024
1 parent f6f7ac3 commit 7aaa968
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ export default function PaidAdsSetupForm( {

// Resolve the starting paid ads data with the campaign data stored in the client session if any.
if ( loadCampaignFromClientSession ) {
const initialAmount = Math.max(
clientSession.getCampaign()?.amount || 0,

Check warning on line 93 in js/src/components/paid-ads/ads-campaign/paid-ads-setup-sections/paid-ads-setup-form.js

View check run for this annotation

Codecov / codecov/patch

js/src/components/paid-ads/ads-campaign/paid-ads-setup-sections/paid-ads-setup-form.js#L92-L93

Added lines #L92 - L93 were not covered by tests
recommendedBudget
);

startingPaidAds = {
...startingPaidAds,
...clientSession.getCampaign(),
amount:
clientSession.getCampaign()?.amount || recommendedBudget,
amount: initialAmount,
};
}

Expand Down

0 comments on commit 7aaa968

Please sign in to comment.