From 3edbc2daf3bcdaf5d0b2ef471d529f13eacf1387 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Fri, 29 May 2026 19:00:12 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20suppression=20indicateur=20save=20redond?= =?UTF-8?q?ant=20dans=20toolbar=20(existait=20d=C3=A9j=C3=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../note-editor/note-editor-toolbar.tsx | 30 +------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/memento-note/components/note-editor/note-editor-toolbar.tsx b/memento-note/components/note-editor/note-editor-toolbar.tsx index 5e4b772..d5e0d6c 100644 --- a/memento-note/components/note-editor/note-editor-toolbar.tsx +++ b/memento-note/components/note-editor/note-editor-toolbar.tsx @@ -1,6 +1,6 @@ 'use client' -import { useState, useRef, useCallback, useEffect } from 'react' +import { useState, useRef, useCallback } from 'react' import { useNoteEditorContext } from './note-editor-context' import { LabelManager } from '@/components/label-manager' import { LabelBadge } from '@/components/label-badge' @@ -46,22 +46,6 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme const [isConverting, setIsConverting] = useState(false) const [shareOpen, setShareOpen] = useState(false) const [flashcardsOpen, setFlashcardsOpen] = useState(false) - const [relativeTime, setRelativeTime] = useState(null) - - // Mise à jour du temps relatif depuis la dernière sauvegarde - useEffect(() => { - if (!state.lastSavedAt) { setRelativeTime(null); return } - const update = () => { - const secs = Math.floor((Date.now() - state.lastSavedAt!.getTime()) / 1000) - if (secs < 10) setRelativeTime(t('notes.savedJustNow') || 'Sauvegardé') - else if (secs < 60) setRelativeTime(`${secs}s`) - else setRelativeTime(`${Math.floor(secs / 60)}min`) - } - update() - const interval = setInterval(update, 10000) - return () => clearInterval(interval) - }, [state.lastSavedAt, t]) - const notebookName = notebooks.find(nb => nb.id === note.notebookId)?.name || null const undoSnapshotRef = useRef<{ content: string; isMarkdown: boolean } | null>(null) @@ -310,18 +294,6 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme {!readOnly && (
- {/* Indicateur dernière sauvegarde */} - {!state.isDirty && relativeTime && !state.isSaving && ( - - - {relativeTime} - - )} - {state.isDirty && !state.isSaving && ( - - {t('notes.unsaved') || '●'} - - )}