-
Notifications
You must be signed in to change notification settings - Fork 5
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
base: dev
Are you sure you want to change the base?
[Content] Prevent new draft from being created on content item creation #2756
Conversation
@@ -101,10 +102,10 @@ export const ItemCreate = () => { | |||
|
|||
// if item doesn't exist, generate a new one | |||
useEffect(() => { | |||
if (isEmpty(item)) { | |||
if (isEmpty(item) && !skipNewItemGeneration) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Fixes #2726