fix: emitNoteChange après enableNoteHistory — carte se met à jour
Some checks failed
CI / Lint, Unit Tests & Build (push) Successful in 5m21s
CI / Deploy production (on server) (push) Failing after 4s

enableNoteHistory() mettait à jour la DB mais ne notifiait pas la home page.
L'éditeur fetch la note à jour (historyEnabled=true) → icône visible.
La home gardait les données en cache (historyEnabled=false) → pas d'icône.

Fix: emitNoteChange({ type: 'updated', note: { ...note, historyEnabled: true } })
dispatché après les 2 points d'appel dans note-document-info-panel.tsx.
This commit is contained in:
Antigravity
2026-06-28 10:02:33 +00:00
parent a1b39959de
commit 89d2ffad46

View File

@@ -16,6 +16,7 @@ import { NoteHistoryModal } from './note-history-modal'
import { NoteNetworkTab } from './note-network-tab'
import { NoteEditorPropertiesPanel } from './structured-views/note-editor-properties-panel'
import { enableNoteHistory, commitNoteHistory, getNoteHistory, deleteNoteHistoryEntry, restoreNoteVersion } from '@/app/actions/notes'
import { emitNoteChange } from '@/lib/note-change-sync'
import { useEffect } from 'react'
type Tab = 'info' | 'versions' | 'network'
@@ -332,6 +333,7 @@ export function NoteDocumentInfoPanel({ note, content, onClose, onNoteRestored }
await enableNoteHistory(note.id)
setHistoryEnabled(true)
setShowHistory(true)
emitNoteChange({ type: 'updated', note: { ...note, historyEnabled: true } })
}}
>
{t('documentInfo.enableHistory')}
@@ -481,6 +483,7 @@ export function NoteDocumentInfoPanel({ note, content, onClose, onNoteRestored }
onEnableHistory={async () => {
await enableNoteHistory(note.id)
setHistoryEnabled(true)
emitNoteChange({ type: 'updated', note: { ...note, historyEnabled: true } })
}}
onRestored={(restored) => {
setShowHistory(false)