Pages corrections journal
This commit is contained in:
parent
886acb7c18
commit
ab660b231e
@ -903,6 +903,13 @@ export default function CarnetPage() {
|
|||||||
currentFolder={selectedFolder}
|
currentFolder={selectedFolder}
|
||||||
onNewNote={handleNewNote}
|
onNewNote={handleNewNote}
|
||||||
onDeleteNote={handleDeleteNote}
|
onDeleteNote={handleDeleteNote}
|
||||||
|
onRefresh={() => {
|
||||||
|
// Force refresh by invalidating cache and fetching fresh data
|
||||||
|
if (session?.user?.id) {
|
||||||
|
invalidateFolderCache(session.user.id, selectedFolder);
|
||||||
|
}
|
||||||
|
fetchNotes(true);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Search, Plus, X, FileText, Calendar, Heart, Users } from 'lucide-react';
|
import { Search, Plus, X, FileText, Calendar, Heart, Users, RefreshCw } from 'lucide-react';
|
||||||
import { format, parse } from 'date-fns';
|
import { format, parse } from 'date-fns';
|
||||||
import { fr } from 'date-fns/locale';
|
import { fr } from 'date-fns/locale';
|
||||||
|
|
||||||
@ -37,7 +37,8 @@ export const NotesView: React.FC<NotesViewProps> = ({
|
|||||||
currentFolder = 'Notes',
|
currentFolder = 'Notes',
|
||||||
onNewNote,
|
onNewNote,
|
||||||
loading = false,
|
loading = false,
|
||||||
onDeleteNote
|
onDeleteNote,
|
||||||
|
onRefresh
|
||||||
}) => {
|
}) => {
|
||||||
const [searchQuery, setSearchQuery] = useState('');
|
const [searchQuery, setSearchQuery] = useState('');
|
||||||
const [hoveredNote, setHoveredNote] = useState<string | null>(null);
|
const [hoveredNote, setHoveredNote] = useState<string | null>(null);
|
||||||
@ -142,12 +143,24 @@ export const NotesView: React.FC<NotesViewProps> = ({
|
|||||||
{FOLDER_DISPLAY_NAMES[currentFolder] || currentFolder}
|
{FOLDER_DISPLAY_NAMES[currentFolder] || currentFolder}
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<div className="flex items-center space-x-2">
|
||||||
onClick={onNewNote}
|
{onRefresh && (
|
||||||
className="p-2 text-carnet-text-primary hover:bg-carnet-hover rounded-md"
|
<button
|
||||||
>
|
onClick={onRefresh}
|
||||||
<Plus className="h-5 w-5" />
|
className="p-2 text-carnet-text-primary hover:bg-carnet-hover rounded-md"
|
||||||
</button>
|
title="Rafraîchir"
|
||||||
|
>
|
||||||
|
<RefreshCw className="h-5 w-5" />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
<button
|
||||||
|
onClick={onNewNote}
|
||||||
|
className="p-2 text-carnet-text-primary hover:bg-carnet-hover rounded-md"
|
||||||
|
title="Nouvelle note"
|
||||||
|
>
|
||||||
|
<Plus className="h-5 w-5" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
<input
|
<input
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class CacheManager {
|
|||||||
|
|
||||||
// Export cache managers for different use cases
|
// Export cache managers for different use cases
|
||||||
export const notesCache = new CacheManager({
|
export const notesCache = new CacheManager({
|
||||||
ttl: 5 * 60 * 1000, // 5 minutes
|
ttl: 2 * 60 * 1000, // 2 minutes (reduced from 5 to ensure fresh data)
|
||||||
keyPrefix: 'notes-cache-'
|
keyPrefix: 'notes-cache-'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user