mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Fix new recipe creation when reloading the /recipes/new page (fixes #536)
This commit is contained in:
parent
23efe0c87a
commit
ad9f336035
@ -6,5 +6,6 @@
|
||||
- Optimized the new compact view (there was a little too much white space at the sides of the page)
|
||||
|
||||
### Recipe improvements/fixes
|
||||
- Fixed that when editing a recipe ingredient which had "Only check if a single unit is in stock" set, not any quantity unit could be picked and the amount stayed empty
|
||||
- Optimized the ordering of the inputs on the recipe ingredient edit page (moved "Only check if a single unit is in stock" before the amount)
|
||||
- Fixed that when editing a recipe ingredient which had "Only check if a single unit is in stock" set, not any quantity unit could be picked and the amount stayed empty
|
||||
- Fixed that when reloading the "new recipe"-page (or when it gets auto-reloaded due to "Auto reload on external changes" is enabled), for each reload a new recipe was created
|
||||
|
@ -381,3 +381,10 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
||||
// Just save the current recipe on every change of the product picker as a workflow could be started which leaves the page...
|
||||
Grocy.Api.Put('objects/recipes/' + Grocy.EditObjectId, $('#recipe-form').serializeJSON(), function () { }, function () { });
|
||||
});
|
||||
|
||||
// As the /recipe/new route immediately creates a new recipe on load,
|
||||
// always replace the current location by the created recipes edit page location
|
||||
if (window.location.pathname.toLowerCase() === "/recipe/new")
|
||||
{
|
||||
window.history.replaceState(null, null, U("/recipe/" + Grocy.EditObjectId));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user