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: Prompt to save when there are unsaved changes #4945

Open
wants to merge 2 commits into
base: mealie-next
Choose a base branch
from

Conversation

SrGesus
Copy link

@SrGesus SrGesus commented Jan 26, 2025

What this PR does / why we need it:

When you are editing a recipe in RecipePage and close the edit mode, there are now unsaved changes but one is not prompted to save those changes.
The discussion on issue #2268 settled on prompting for saving when the close is clicked, but i think it would make more sense to prompt for unsaved changes on exit, where they are already being prompted (but were previously only if edit mode was on).
So to achieve this the only changes that need to be done are removing the condition of being in editing mode to be prompted for unsaved changes, and to fix an issue regarding the saving not updating the originalRecipe that should be updated whenever the recipe is saved.
Also adding a snackbar when not in edit mode where you can choose to discard the changes, and the original recipe will be displayed.

Which issue(s) this PR fixes:

Fixes #2268

@SrGesus SrGesus force-pushed the fix-recipe-unsaved-settings branch 3 times, most recently from 0524a1b to fb8e020 Compare January 27, 2025 18:14
@SrGesus SrGesus marked this pull request as ready for review January 27, 2025 18:15
@SrGesus SrGesus force-pushed the fix-recipe-unsaved-settings branch from fb8e020 to 6f5d147 Compare January 27, 2025 18:19
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.

[v1.0.0b] - Closing a recipe from edit shows cached recipe initially
1 participant