File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ export const IngredientFormField = React.memo(function IngredientFormField(props
6565 } ) ;
6666 } ;
6767
68+ const onUnitChange = ( newUnit : string ) => {
69+ setUnit ( newUnit ) ;
70+ invokeIngredientUpdate ( ingredientQuery , amount , newUnit ) ;
71+ } ;
72+
6873 const onAmountChange = ( text : string ) => {
6974 text = text . replace ( ',' , '.' ) ;
7075 setAmount ( text ) ;
@@ -102,7 +107,7 @@ export const IngredientFormField = React.memo(function IngredientFormField(props
102107 label = { t ( 'screens.editRecipe.unit' ) }
103108 value = { unit }
104109 options = { availableUnits . map ( ( availableUnit , index ) => ( { key : index . toString ( ) , value : availableUnit } ) ) }
105- onValueChanged = { ( selectedOption ) => setUnit ( selectedOption . value ) }
110+ onValueChanged = { ( selectedOption ) => onUnitChange ( selectedOption . value ) }
106111 />
107112 </ View >
108113 < Spacer height = { 5 } />
You can’t perform that action at this time.
0 commit comments