chore: fix project errors
This commit is contained in:
+10
-10
@@ -95,16 +95,16 @@ export function delay(seconds: number) {
|
|||||||
return new Promise(resolve => setTimeout(resolve, seconds));
|
return new Promise(resolve => setTimeout(resolve, seconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getIcon(category: string) {
|
const icons = {
|
||||||
const icons = {
|
'fats': '🥑 🍳 🍟',
|
||||||
'fats': '🥑 🍳 🍟',
|
'proteins': '🫘 🥩 🥚',
|
||||||
'proteins': '🫘 🥩 🥚',
|
'carbs': '🍞 🥔 🍠',
|
||||||
'carbs': '🍞 🥔 🍠',
|
'leaves': '🥬 🥗 🌿',
|
||||||
'leaves': '🥬 🥗 🌿',
|
'fruits': '🍊 🍇 🍎',
|
||||||
'fruits': '🍊 🍇 🍎',
|
'low carb': '🥦 🍅 🍓',
|
||||||
'low carb': '🥦 🍅 🍓',
|
'dairy': '🧀 🧈 🥛'
|
||||||
'dairy': '🧀 🧈 🥛'
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
export function getIcon(category: keyof typeof icons) {
|
||||||
return icons[category];
|
return icons[category];
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-7
@@ -1,10 +1,10 @@
|
|||||||
import { foodDatabase } from './foodDatabase.js';
|
import { foodDatabase } from './foodDatabase.js';
|
||||||
import { getButtonById, getButtonListByClassName, getDivById, getInputById, showFoodPreview } from './DomUtils.ts';
|
import { getButtonById, getButtonListByClassName, getDivById, getInputById, showFoodPreview } from './DomUtils';
|
||||||
import { DailyTotalCalories, FoodItem, FoodStorage, MealGroup, MealPeriod } from './types.js';
|
import { DailyTotalCalories, FoodItem, FoodStorage, MealGroup, MealPeriod } from './types.js';
|
||||||
import { AppwriteAuth, AppwriteDB } from './appwrite.js';
|
import { AppwriteAuth, AppwriteDB } from './appwrite.js';
|
||||||
import swal from 'sweetalert';
|
import swal from 'sweetalert';
|
||||||
import { closeMobileMenu, delay, getCleanName, getIcon, handleMobileCalendarClick, hideLoading, hideSearchResults, navigateResultsKeyboard, QUICK_DELAY, scrollToCalendarView, showLoading, toggleCardHandler, toggleMobileMenu } from './Utils.ts';
|
import { closeMobileMenu, delay, getCleanName, getIcon, handleMobileCalendarClick, hideLoading, hideSearchResults, navigateResultsKeyboard, QUICK_DELAY, scrollToCalendarView, showLoading, toggleCardHandler, toggleMobileMenu } from './Utils';
|
||||||
import { showAuthForms, toggleAuthForms, showRegisterForm, showLoginForm, hideAuthForms, closeAuthModal } from './auth.ts';
|
import { showAuthForms, toggleAuthForms, showRegisterForm, showLoginForm, hideAuthForms, closeAuthModal } from './auth';
|
||||||
import { appState } from "./state";
|
import { appState } from "./state";
|
||||||
import { getNutritionInfo, NutritionInfo, clearNutritionCache, getCacheStats } from './claudeService';
|
import { getNutritionInfo, NutritionInfo, clearNutritionCache, getCacheStats } from './claudeService';
|
||||||
|
|
||||||
@@ -17,10 +17,7 @@ const updateSW = registerSW({
|
|||||||
title: 'Update Available',
|
title: 'Update Available',
|
||||||
text: 'New content is available. Reload to update?',
|
text: 'New content is available. Reload to update?',
|
||||||
icon: 'info',
|
icon: 'info',
|
||||||
buttons: {
|
buttons: ['Later', 'Update Now']
|
||||||
cancel: 'Later',
|
|
||||||
confirm: 'Update Now'
|
|
||||||
}
|
|
||||||
}).then((willUpdate) => {
|
}).then((willUpdate) => {
|
||||||
if (willUpdate) {
|
if (willUpdate) {
|
||||||
updateSW(true)
|
updateSW(true)
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"strict": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||||
|
"types": ["vite/client"]
|
||||||
|
},
|
||||||
|
"include": ["src"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user