fix(editor): save-on-close & correct image tracking
- Auto-sauvegarde à la fermeture de l'éditeur fullPage si isDirty (évite que la vignette reste après suppression d'image sans Ctrl+S) - Correction de resolveImagesForSave : fusion des images contenu HTML + images standalone (hors éditeur) en excluant les removedImageUrls, pour ne pas perdre les images uploadées séparément à la sauvegarde
This commit is contained in:
@@ -91,10 +91,17 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme
|
||||
}
|
||||
|
||||
if (mode === 'fullPage') {
|
||||
const handleCloseWithSave = async () => {
|
||||
if (state.isDirty && !state.isSaving) {
|
||||
await actions.handleSaveInPlace()
|
||||
}
|
||||
onClose()
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="px-4 sm:px-8 md:px-12 py-4 sm:py-6 md:py-8 flex items-center justify-between sticky top-0 bg-white/95 dark:bg-background/95 backdrop-blur-sm z-40 border-b border-border dark:border-white/10">
|
||||
<button
|
||||
onClick={onClose}
|
||||
onClick={handleCloseWithSave}
|
||||
className="flex items-center gap-2 text-foreground hover:opacity-60 transition-opacity"
|
||||
>
|
||||
<ArrowLeft size={18} />
|
||||
|
||||
Reference in New Issue
Block a user