Skip to content

Commit

Permalink
refactor: Update check for first publish
Browse files Browse the repository at this point in the history
  • Loading branch information
kjohnson committed Feb 7, 2025
1 parent fb9cd76 commit 401bc6a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export default function CampaignsDetailsPage({campaignId}) {
const onSubmit: SubmitHandler<Campaign> = async (data) => {

const shouldSave = formState.isDirty
// Force save if the status is active to account for a first publish race condition.
|| data.status === 'active';
// Force save if first publish to account for a race condition.
|| (campaign.status === 'draft' && data.status === 'active');

if (shouldSave) {
setIsSaving(data.status);
Expand Down

0 comments on commit 401bc6a

Please sign in to comment.