fix: move useEffect after loadNotebooks declaration (TS error)
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 22s

Made-with: Cursor
This commit is contained in:
2026-04-26 00:02:03 +02:00
parent 1164a4a30e
commit 310904e5a3

View File

@@ -86,11 +86,6 @@ export function NotebooksProvider({ children, initialNotebooks = [] }: Notebooks
const [error, setError] = useState<string | null>(null)
const { triggerRefresh, refreshKey } = useNoteRefresh()
// Recharge les carnets à chaque fois qu'une note est modifiée/supprimée
useEffect(() => {
if (refreshKey > 0) loadNotebooks()
}, [refreshKey, loadNotebooks])
// ===== DERIVED STATE =====
const currentLabels = useMemo(() => {
if (!currentNotebook) return []
@@ -120,6 +115,11 @@ export function NotebooksProvider({ children, initialNotebooks = [] }: Notebooks
loadNotebooks()
}, [loadNotebooks])
// Recharge les carnets à chaque fois qu'une note est modifiée/supprimée
useEffect(() => {
if (refreshKey > 0) loadNotebooks()
}, [refreshKey, loadNotebooks])
// ===== ACTIONS: NOTEBOOKS =====
const createNotebookOptimistic = useCallback(async (data: CreateNotebookInput) => {
const response = await fetch('/api/notebooks', {