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

Improved message when clicking "Launch Course Builder" with unsaved changes #211

Closed

Conversation

brianhogg
Copy link
Contributor

Description

Fixes #210

How has this been tested?

Manually

Screenshots

Captura de pantalla 2024-02-29 a las 4 05 55 p  m

Checklist:

  • This PR requires and contains at least one changelog file.
  • My code has been tested.
  • My code passes all existing automated tests.
  • My code follows the LifterLMS Coding & Documentation Standards.

@brianhogg brianhogg requested a review from ideadude as a code owner February 29, 2024 15:06
@brianhogg brianhogg marked this pull request as draft February 29, 2024 15:36
@brianhogg
Copy link
Contributor Author

brianhogg commented Feb 29, 2024

After saving Draft on a brand new course, it's still showing the message to save unsaved changes.

For some reason wp.data.select('core/editor').getPostEdits() has the array of default course content, and when the draft saves, it still has that content.

https://developer.wordpress.org/block-editor/reference-guides/data/data-core-editor/#getpostedits

@brianhogg
Copy link
Contributor Author

This also blocks the "Auto Draft" fix if they don't edit anything and try to go to Launch Course Builder. This might be confusing or a flow we want to keep.

@brianhogg
Copy link
Contributor Author

brianhogg commented Mar 1, 2024

Submitted bug report for Gutenberg. I'm not seeing a workaround for this. Except perhaps saving on initial load what the initial block listing is, but I think if you add a block then save draft that extra block will also remain in the results for getPostEdits() WordPress/gutenberg#59510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants