fix: update visionData cache immediately before network save
Prevents stale reads when renderMoodboard runs after saveVisionSection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-4
@@ -1013,13 +1013,12 @@ function showSaved() {
|
||||
async function saveVisionSection(section, contenu) {
|
||||
const row = visionData[section];
|
||||
if (!row) return;
|
||||
await fetch(`/api/vision/${row.Id}`, {
|
||||
row.Contenu = contenu; // update local cache immediately
|
||||
fetch(`/api/vision/${row.Id}`, {
|
||||
method: 'PATCH',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ Contenu: contenu }),
|
||||
});
|
||||
row.Contenu = contenu;
|
||||
showSaved();
|
||||
}).then(() => showSaved());
|
||||
}
|
||||
|
||||
function setupEditable(elId, section) {
|
||||
|
||||
Reference in New Issue
Block a user