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