Skip to content

Commit

Permalink
fixed navigation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BrentpHopkins committed Feb 27, 2023
1 parent 69eedf2 commit 89fe5f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Screens/EntryDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@ const FoodDetails = ({route}) => {

const UpdateFood = () =>{
food.setServings(servings);
navigation.dispatch(StackActions.pop(2))
navigation.navigate("Diary")
navigation.reset({
index: 0,
routes: [{ name: 'Diary' }],
});
}
const RemoveFood = () =>{

let index = meal.indexOf(food)
meal.splice(index,1)
console.log(meal)
navigation.dispatch(StackActions.pop(2))
navigation.navigate("Diary")
navigation.reset({
index: 0,
routes: [{ name: 'Diary' }],
});
}

return(
Expand Down

0 comments on commit 89fe5f1

Please sign in to comment.