Skip to main content

confirmDiscardChanges()

confirmDiscardChanges(editors, options?): Promise<boolean>

Defined in: js-api/src/ui/domains/domains-editor.ts:1786

THE gate an app puts in front of a rebuild: resolves to whether the caller may proceed, having saved or discarded whatever was pending.

  • nothing dirty — proceeds silently, no dialog;
  • a save in flight — refuses (an editor is closed while its transaction runs, and prompting would offer a save that cannot be taken); the caller may retry after onSavingChanged;
  • otherwise it prompts and applies the answer: save writes every pending batch (a FAILED save cancels the navigation — the user keeps their changes and the error), discard drops them, cancel stays.

A DomainSession saves as ONE transaction; a plain list of editors saves each on its own (a session of one apiece).

Parameters

ParameterType
editorsDomainSession | DomainFrameEditor[]
options?UnsavedPromptOptions

Returns

Promise<boolean>