Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Content] Prevent new draft from being created on content item creation #2756

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

finnar-bin
Copy link
Contributor

Fixes #2726

@finnar-bin finnar-bin added bug Something isn't working ready PR is complete and ready for deployment labels Jun 18, 2024
@finnar-bin finnar-bin self-assigned this Jun 18, 2024
@finnar-bin finnar-bin enabled auto-merge (squash) June 18, 2024 02:56
@@ -101,10 +102,10 @@ export const ItemCreate = () => {

// if item doesn't exist, generate a new one
useEffect(() => {
if (isEmpty(item)) {
if (isEmpty(item) && !skipNewItemGeneration) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This solution is kinda hacky. Can we not prevent this useEffect from firing in a traditional way? Im assuming the save is causing item to mutate but cant we navigate away (unmount) before doing so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. This will prevent the creation of a new draft while the new item is being saved

@finnar-bin finnar-bin requested a review from agalin920 July 2, 2024 04:18
@finnar-bin finnar-bin changed the title Prevent new draft from being created on content item creation [Content] Prevent new draft from being created on content item creation Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready PR is complete and ready for deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create new item page always makes a new draft after creating an item
2 participants