Skip to content

Commit

Permalink
Editor: Fix initial edits applied again after saving the post (#68273)
Browse files Browse the repository at this point in the history
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: ramonjd <[email protected]>
  • Loading branch information
4 people authored Dec 25, 2024
1 parent 227fcd8 commit 63f211b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,11 @@ export const ExperimentalEditorProvider = withRegistryProvider(
}
);
}
}, [
createWarningNotice,
initialEdits,
settings,
post,
recovery,
setupEditor,
updatePostLock,
] );

// The dependencies of the hook are omitted deliberately
// We only want to run setupEditor (with initialEdits) only once per post.
// A better solution in the future would be to split this effect into multiple ones.
}, [] );

// Synchronizes the active post with the state
useEffect( () => {
Expand Down

1 comment on commit 63f211b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 63f211b.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12494154896
📝 Reported issues:

Please sign in to comment.