version
#
This commit is contained in:
@@ -123,7 +123,7 @@ export function initEditor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function markDirty() {
|
function markDirty() {
|
||||||
if (suppressDirty) return;
|
if (suppressDirty || !baselineReady) return;
|
||||||
isDirty = true;
|
isDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ export function initEditor() {
|
|||||||
const fields = extractContentFields(payload);
|
const fields = extractContentFields(payload);
|
||||||
savedSnapshot = buildSnapshot(fields);
|
savedSnapshot = buildSnapshot(fields);
|
||||||
clearDirty();
|
clearDirty();
|
||||||
baselineReady = true;
|
baselineReady = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function syncSnapshotFromEditor() {
|
async function syncSnapshotFromEditor() {
|
||||||
@@ -222,10 +222,7 @@ export function initEditor() {
|
|||||||
async function hasUnsavedChanges() {
|
async function hasUnsavedChanges() {
|
||||||
if (!baselineReady) return false;
|
if (!baselineReady) return false;
|
||||||
if (suppressDirty) return false;
|
if (suppressDirty) return false;
|
||||||
if (!savedSnapshot) return false;
|
return isDirty;
|
||||||
const currentSnapshot = await buildCurrentSnapshot();
|
|
||||||
if (!currentSnapshot) return false;
|
|
||||||
return currentSnapshot !== savedSnapshot;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showUnsavedDialog() {
|
function showUnsavedDialog() {
|
||||||
|
|||||||
Reference in New Issue
Block a user