Spaces:
Sleeping
Sleeping
Update static/script.js
Browse files- static/script.js +2 -1
static/script.js
CHANGED
|
@@ -74,7 +74,7 @@ function handleResponse(userInput) {
|
|
| 74 |
} 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')) {
|
| 75 |
// Fetch ingredients based on previous food preference (Vegetarian or Non-Vegetarian)
|
| 76 |
const foodPreference = conversation.find(msg => msg.role === 'user' && (msg.message.includes('vegetarian') || msg.message.includes('non-vegetarian')))?.message.toLowerCase();
|
| 77 |
-
|
| 78 |
console.log("Previous food preference: " + foodPreference); // Debug which food preference is selected
|
| 79 |
|
| 80 |
if (foodPreference === 'vegetarian') {
|
|
@@ -94,6 +94,7 @@ function handleResponse(userInput) {
|
|
| 94 |
}
|
| 95 |
|
| 96 |
|
|
|
|
| 97 |
function fetchIngredients(foodPreference) {
|
| 98 |
fetch('/get_ingredients', {
|
| 99 |
method: 'POST',
|
|
|
|
| 74 |
} 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')) {
|
| 75 |
// Fetch ingredients based on previous food preference (Vegetarian or Non-Vegetarian)
|
| 76 |
const foodPreference = conversation.find(msg => msg.role === 'user' && (msg.message.includes('vegetarian') || msg.message.includes('non-vegetarian')))?.message.toLowerCase();
|
| 77 |
+
|
| 78 |
console.log("Previous food preference: " + foodPreference); // Debug which food preference is selected
|
| 79 |
|
| 80 |
if (foodPreference === 'vegetarian') {
|
|
|
|
| 94 |
}
|
| 95 |
|
| 96 |
|
| 97 |
+
|
| 98 |
function fetchIngredients(foodPreference) {
|
| 99 |
fetch('/get_ingredients', {
|
| 100 |
method: 'POST',
|