Fix bugs
This commit is contained in:
parent
f2674c379c
commit
9f781d784d
@ -48,8 +48,8 @@ function RecipeDetails({ recipe, onEditClick, onDeleteClick, onShowDeleteModal,
|
|||||||
<p className="recipe-subtitle">
|
<p className="recipe-subtitle">
|
||||||
{translateMealType(recipe.meal_type)} · {recipe.time_minutes} דקות הכנה
|
{translateMealType(recipe.meal_type)} · {recipe.time_minutes} דקות הכנה
|
||||||
</p>
|
</p>
|
||||||
{(recipe.owner_display_name || recipe.made_by) && (
|
{(recipe.made_by || recipe.owner_display_name) && (
|
||||||
<h4 className="recipe-made-by">המתכון של: {recipe.owner_display_name || recipe.made_by}</h4>
|
<h4 className="recipe-made-by">המתכון של: {recipe.made_by || recipe.owner_display_name}</h4>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="pill-row">
|
<div className="pill-row">
|
||||||
|
|||||||
@ -216,6 +216,12 @@ function RecipeFormDrawer({ open, onClose, onSubmit, editingRecipe = null, curre
|
|||||||
ref={idx === ingredients.length - 1 ? lastIngredientRef : null}
|
ref={idx === ingredients.length - 1 ? lastIngredientRef : null}
|
||||||
value={val}
|
value={val}
|
||||||
onChange={(e) => handleChangeIngredient(idx, e.target.value)}
|
onChange={(e) => handleChangeIngredient(idx, e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
e.preventDefault();
|
||||||
|
handleAddIngredient();
|
||||||
|
}
|
||||||
|
}}
|
||||||
placeholder="למשל: 2 ביצים"
|
placeholder="למשל: 2 ביצים"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
@ -246,6 +252,12 @@ function RecipeFormDrawer({ open, onClose, onSubmit, editingRecipe = null, curre
|
|||||||
ref={idx === steps.length - 1 ? lastStepRef : null}
|
ref={idx === steps.length - 1 ? lastStepRef : null}
|
||||||
value={val}
|
value={val}
|
||||||
onChange={(e) => handleChangeStep(idx, e.target.value)}
|
onChange={(e) => handleChangeStep(idx, e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
e.preventDefault();
|
||||||
|
handleAddStep();
|
||||||
|
}
|
||||||
|
}}
|
||||||
placeholder="למשל: לחמם את התנור ל־180 מעלות"
|
placeholder="למשל: לחמם את התנור ל־180 מעלות"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@ -39,11 +39,16 @@ function RecipeSearchList({
|
|||||||
// Extract unique meal types from ALL recipes (not filtered)
|
// Extract unique meal types from ALL recipes (not filtered)
|
||||||
const mealTypes = Array.from(new Set(allRecipes.map((r) => r.meal_type))).sort();
|
const mealTypes = Array.from(new Set(allRecipes.map((r) => r.meal_type))).sort();
|
||||||
|
|
||||||
// Extract unique made_by (username) from ALL recipes and map to display names
|
// Extract unique made_by values from ALL recipes
|
||||||
|
// The made_by field is what the user defined when creating the recipe,
|
||||||
|
// so we use it for both filtering and display
|
||||||
const madeByMap = new Map();
|
const madeByMap = new Map();
|
||||||
allRecipes.forEach((r) => {
|
allRecipes.forEach((r) => {
|
||||||
if (r.made_by && r.owner_display_name) {
|
if (r.made_by) {
|
||||||
madeByMap.set(r.made_by, r.owner_display_name);
|
// Always use made_by as the display name (it's the custom name the user entered)
|
||||||
|
if (!madeByMap.has(r.made_by)) {
|
||||||
|
madeByMap.set(r.made_by, r.made_by);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const allMadeBy = Array.from(madeByMap.keys()).sort();
|
const allMadeBy = Array.from(madeByMap.keys()).sort();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user