diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx index b5b9030..f6b22a9 100644 --- a/src/pages/Index.tsx +++ b/src/pages/Index.tsx @@ -255,10 +255,7 @@ const Index = () => { const loadNotes = async () => { try { - console.log('[DEBUG] Fetching notes from API...'); const fetchedNotes = await NotesService.getNotes(); - console.log('[DEBUG] Notes fetched:', fetchedNotes.length, 'notes'); - console.log('[DEBUG] Notes data:', fetchedNotes); if (Array.isArray(fetchedNotes)) { setNotes(fetchedNotes); } @@ -860,25 +857,14 @@ const Index = () => { ).values() ).sort((a, b) => a.name.localeCompare(b.name)); - // Debug logging - console.log('=== NOTES FILTER DEBUG ==='); - console.log('Total notes:', notes.length); - console.log('Show archived:', showArchived); - console.log('Search query:', searchQuery); - console.log('Search filters:', searchFilters); - const filteredNotes = notes.filter(note => { // Archived filter - if (showArchived ? !note.archived : note.archived) { - console.log('Note filtered by archived status:', note.id, note.title); - return false; - } + if (showArchived ? !note.archived : note.archived) return false; // Text search if (searchQuery !== "" && !(note.title && note.title.toLowerCase().includes(searchQuery.toLowerCase())) && !(note.content && note.content.toLowerCase().includes(searchQuery.toLowerCase()))) { - console.log('Note filtered by search query:', note.id, note.title); return false; } @@ -886,7 +872,6 @@ const Index = () => { if (searchFilters.tags.length > 0) { const noteTags = (note.tags || []).map(t => t.name); if (!searchFilters.tags.some(filterTag => noteTags.includes(filterTag))) { - console.log('Note filtered by tags:', note.id, note.title); return false; } } @@ -897,51 +882,38 @@ const Index = () => { if (searchFilters.dateFrom) { const fromDate = new Date(searchFilters.dateFrom); fromDate.setHours(0, 0, 0, 0); - if (noteDate < fromDate) { - console.log('Note filtered by dateFrom:', note.id, note.title); - return false; - } + if (noteDate < fromDate) return false; } if (searchFilters.dateTo) { const toDate = new Date(searchFilters.dateTo); toDate.setHours(23, 59, 59, 999); - if (noteDate > toDate) { - console.log('Note filtered by dateTo:', note.id, note.title); - return false; - } + if (noteDate > toDate) return false; } } // Has todos filter if (searchFilters.hasTodos && (!note.todos || note.todos.length === 0)) { - console.log('Note filtered by hasTodos:', note.id, note.title); return false; } // Has images filter if (searchFilters.hasImages && (!note.images || note.images.length === 0)) { - console.log('Note filtered by hasImages:', note.id, note.title); return false; } // Has files filter if (searchFilters.hasFiles && (!note.files || note.files.length === 0)) { - console.log('Note filtered by hasFiles:', note.id, note.title); return false; } // Priority filter if (searchFilters.priority && !note.priority) { - console.log('Note filtered by priority:', note.id, note.title); return false; } return true; }); - console.log('Filtered notes:', filteredNotes.length); - console.log('========================'); - // Pagination for notes const totalNotesPages = Math.ceil(filteredNotes.length / NOTES_PER_PAGE); const paginatedNotes = filteredNotes.slice( @@ -1303,15 +1275,6 @@ const Index = () => {

Mes Notes

- - {/* DEBUG PANEL - TEMPORARY */} -
-
DEBUG: Total: {notes.length} | Filtered: {filteredNotes.length}
-
Archived: {showArchived ? 'YES' : 'NO'} | Query: '{searchQuery}'
-
Tags: {searchFilters.tags.length} | Dates: {searchFilters.dateFrom ? 'FROM' : ''} {searchFilters.dateTo ? 'TO' : ''}
-
hasTodos: {String(searchFilters.hasTodos)} | hasImages: {String(searchFilters.hasImages)} | hasFiles: {String(searchFilters.hasFiles)} | priority: {String(searchFilters.priority)}
-
-