Skip to main content

confirmDiscardChanges()

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

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

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.

Parameters

ParameterType
editorsDomainFrameEditor[]
options?UnsavedPromptOptions

Returns

Promise<boolean>