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

fix: JSON Mode Resets Page State #4519

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

We have a cleanup function clearPageState which runs when we leave the recipe page. However, it actually runs when a particular component is unmounted, rather than the page itself. In most instances this is fine because the component isn't unmounted until leaving edit mode, except JSON mode unmounts the component too. This causes the page state to reset prematurely, which has some funky effects (namely instructions are no longer editable).

This PR moves the cleanup method to the page component, ensuring it doesn't run until the user actually leaves the recipe page.

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #4509 (comment)

Special notes for your reviewer:

(fill-in or delete this section)

Took some work to diagnose this one, but was otherwise a pretty simple fix.

Testing

(fill-in or delete this section)

Manually.

@github-actions github-actions bot added the bugfix label Nov 6, 2024
@hay-kot hay-kot enabled auto-merge (squash) November 7, 2024 17:34
@hay-kot hay-kot merged commit e3c6d4c into mealie-recipes:mealie-next Nov 7, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Toggling out of JSON view in the recipe editing interface the instruction section becomes read-only
2 participants