nagasurendra commited on
Commit
557a1e6
·
verified ·
1 Parent(s): 4c82fa4

Update templates/customdish.html

Browse files
Files changed (1) hide show
  1. templates/customdish.html +9 -6
templates/customdish.html CHANGED
@@ -461,12 +461,15 @@
461
  let botResponse = '';
462
  let options = [];
463
 
464
- if (conversation.length === 2) { // After name input
465
- botResponse = `Nice to meet you, ${userInput}! 😊 Let's create your perfect meal! What type of food would you prefer?`;
466
- options = [
467
- { text: 'Vegetarian', class: 'green' },
468
- { text: 'Non-Vegetarian', class: 'red' }
469
- ];
 
 
 
470
  } else if (lastMessage.includes('non-vegetarian')) {
471
  conversation.push({ role: 'user', message: 'Non-Vegetarian' });
472
  console.log("Food preference selected: Non-Vegetarian");
 
461
  let botResponse = '';
462
  let options = [];
463
 
464
+ // If user has already selected food type, proceed without repeating the question
465
+ if (conversation.length === 2 && userInput) {
466
+ // Check if it's the initial greeting with the food type preference
467
+ if (userInput === "vegetarian" || userInput === "non-vegetarian") {
468
+ botResponse = `Nice to meet you, ${userInput}! 😊 Let's create your perfect meal!`;
469
+ options = [
470
+ { text: 'Go Back', class: 'gray' }
471
+ ];
472
+ }
473
  } else if (lastMessage.includes('non-vegetarian')) {
474
  conversation.push({ role: 'user', message: 'Non-Vegetarian' });
475
  console.log("Food preference selected: Non-Vegetarian");