Update templates/customdish.html
Browse files
templates/customdish.html
CHANGED
@@ -461,12 +461,15 @@
|
|
461 |
let botResponse = '';
|
462 |
let options = [];
|
463 |
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
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");
|