update model list
Browse filesFiles changed (2)
35 unmodified lines36373839404142434445464748495035 unmodified lines const [isResizingSettings, setIsResizingSettings] = useState(false); const [isDesktop, setIsDesktop] = useState(false);
// Clear cache on app startup to ensure fresh data useEffect(() => { if (typeof window !== 'undefined') { console.log('[Cache] Clearing models and languages cache on app startup'); localStorage.removeItem('anycoder_models'); localStorage.removeItem('anycoder_languages'); } }, []); // Run once on mount
// Load messages from localStorage on mount (client-side only to avoid hydration issues) useEffect(() => { if (typeof window !== 'undefined') {149 unmodified lines1501511521531531541551568 unmodified lines16516616716816816917017126 unmodified lines1981992002012012022032048 unmodified lines213214215216216217218219149 unmodified lines }
async getModels(): Promise<Model[]> { // Check cache first (24 hour TTL) // Check cache first (24 hour TTL - cache once per day) const cached = this.getCachedData<Model[]>('anycoder_models', 24 * 60 * 60 * 1000); if (cached) { console.log('Using cached models:', cached.length, 'models');8 unmodified lines // Cache the successful response if (models && models.length > 0) { this.setCachedData('anycoder_models', models); console.log('Cached', models.length, 'models'); console.log('Cached', models.length, 'models (valid for 24 hours)'); } return models;26 unmodified lines }
async getLanguages(): Promise<{ languages: Language[] }> { // Check cache first (24 hour TTL) // Check cache first (24 hour TTL - cache once per day) const cached = this.getCachedData<Language[]>('anycoder_languages', 24 * 60 * 60 * 1000); if (cached) { console.log('Using cached languages:', cached.length, 'languages');8 unmodified lines // Cache the successful response if (languages && languages.length > 0) { this.setCachedData('anycoder_languages', languages); console.log('Cached', languages.length, 'languages'); console.log('Cached', languages.length, 'languages (valid for 24 hours)'); } return response.data;frontend/src/app/page.tsx+9
frontend/src/lib/api.ts+4-4