fix(app): editor store keeps an unanswered copy across mode changes, refuses unsaved submit
This commit is contained in:
1 parent
7f1d44065b
commit
b14509f221
7 files changed
+102
-4
No files matched your search
@@ -210,6 +210,7 @@ export async function discardChanges(
|
||||
const state = api.get()
|
||||
const block = blockKind(state)
|
||||
if (block || !state.preview) return { ok: false, reason: 'blocked', kind: block ?? 'not_ready' }
|
||||
if (state.saving || state.submitting) return { ok: false, reason: 'blocked', kind: 'busy' }
|
||||
if (!option.confirmed) return { ok: false, reason: 'blocked', kind: 'confirmation_required' }
|
||||
if (state.staleBase) return reloadServerDraft(api, option)
|
||||
const replaced = state.preview.replaceDocument(state.savedText)
|
||||
|
||||
Reference in new issue
Block a user