Skip to content

Commit

Permalink
Handle salad empty fridge
Browse files Browse the repository at this point in the history
  • Loading branch information
kochaika committed Oct 2, 2024
1 parent a983ff7 commit be54f7e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions culinaryFrontend/src/components/screens/MainActionsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export default function MainActionsScreen({gameStateSetter}: MainActionsScreenPr
const tasteBadMsg = "It tastes so bad... Try to cook the soup again."
const tasteErrMsg = "Failed to get taste status. Check your implementation."

const saladEmptyListMsg = "Try to refill the fridge!"

const soupName = "tomato soup"
const saladListName = "salad (list)"
const saladSequenceName = "salad (sequence)"
Expand Down Expand Up @@ -652,11 +654,11 @@ export default function MainActionsScreen({gameStateSetter}: MainActionsScreenPr
<>
<button
className={"App-button-base App-button-action-wide " + (fridgeProducts.length > 0 && shouldShow(saladListName) ? "" : "App-button-disable")}
onClick={() => cook(saladListUrl, saladListName)}>Salad list
onClick={() => cook(saladListUrl, saladListName, saladEmptyListMsg)}>Salad list
</button>
<button
className={"App-button-base App-button-action-wide " + (fridgeProducts.length > 0 && shouldShow(saladSequenceName) ? "" : "App-button-disable")}
onClick={() => cook(saladSequenceUrl, saladSequenceName)}>Salad seq.
onClick={() => cook(saladSequenceUrl, saladSequenceName, saladEmptyListMsg)}>Salad seq.
</button>
</>
)}
Expand Down

0 comments on commit be54f7e

Please sign in to comment.