Spaces:
Sleeping
Sleeping
Update static/script.js
Browse files- static/script.js +3 -3
static/script.js
CHANGED
|
@@ -48,7 +48,7 @@ function handleResponse(userInput) {
|
|
| 48 |
{ text: 'Vegetarian', class: 'green' },
|
| 49 |
{ text: 'Non-Vegetarian', class: 'red' }
|
| 50 |
];
|
| 51 |
-
else if (lastMessage.includes('non-vegetarian') || lastMessage.includes('non veg') || lastMessage.includes('nonveg')) {
|
| 52 |
botResponse = 'Great choice! 🍽️ We have some amazing non-vegetarian options! What\'s your dietary preference?';
|
| 53 |
options = [
|
| 54 |
{ text: 'Low Carb', class: '' },
|
|
@@ -67,8 +67,7 @@ function handleResponse(userInput) {
|
|
| 67 |
{ text: 'Keto', class: '' },
|
| 68 |
{ text: 'Halal', class: '' }
|
| 69 |
];
|
| 70 |
-
}
|
| 71 |
-
else if (lastMessage.includes('low carb') || lastMessage.includes('dairy-free') || lastMessage.includes('keto') || lastMessage.includes('halal') || lastMessage.includes('gluten-free') || lastMessage.includes('vegan') || lastMessage.includes('vegetarian')) {
|
| 72 |
fetchIngredients(lastMessage); // Handle ingredient fetch based on dietary preference
|
| 73 |
return; // Exit early to fetch ingredients
|
| 74 |
}
|
|
@@ -80,6 +79,7 @@ function handleResponse(userInput) {
|
|
| 80 |
}
|
| 81 |
|
| 82 |
|
|
|
|
| 83 |
function fetchIngredients(dietaryPreference) {
|
| 84 |
fetch('/get_ingredients', {
|
| 85 |
method: 'POST',
|
|
|
|
| 48 |
{ text: 'Vegetarian', class: 'green' },
|
| 49 |
{ text: 'Non-Vegetarian', class: 'red' }
|
| 50 |
];
|
| 51 |
+
} else if (lastMessage.includes('non-vegetarian') || lastMessage.includes('non veg') || lastMessage.includes('nonveg')) {
|
| 52 |
botResponse = 'Great choice! 🍽️ We have some amazing non-vegetarian options! What\'s your dietary preference?';
|
| 53 |
options = [
|
| 54 |
{ text: 'Low Carb', class: '' },
|
|
|
|
| 67 |
{ text: 'Keto', class: '' },
|
| 68 |
{ text: 'Halal', class: '' }
|
| 69 |
];
|
| 70 |
+
} else if (lastMessage.includes('low carb') || lastMessage.includes('dairy-free') || lastMessage.includes('keto') || lastMessage.includes('halal') || lastMessage.includes('gluten-free') || lastMessage.includes('vegan') || lastMessage.includes('vegetarian')) {
|
|
|
|
| 71 |
fetchIngredients(lastMessage); // Handle ingredient fetch based on dietary preference
|
| 72 |
return; // Exit early to fetch ingredients
|
| 73 |
}
|
|
|
|
| 79 |
}
|
| 80 |
|
| 81 |
|
| 82 |
+
|
| 83 |
function fetchIngredients(dietaryPreference) {
|
| 84 |
fetch('/get_ingredients', {
|
| 85 |
method: 'POST',
|