diff --git a/src/frontend/components/form-group/autosave/lib/modal.js b/src/frontend/components/form-group/autosave/lib/modal.js index 60da420fd..4abdf17f5 100644 --- a/src/frontend/components/form-group/autosave/lib/modal.js +++ b/src/frontend/components/form-group/autosave/lib/modal.js @@ -9,6 +9,8 @@ class AutosaveModal extends AutosaveBase { $modal.find('.btn-js-restore-values').on('click', async (e) => { e.preventDefault(); + let errored = false; + let $list = $(""); const $body = $modal.find(".modal-body"); $body.html("

Restoring values...

").append($list); @@ -32,9 +34,10 @@ class AutosaveModal extends AutosaveBase { const $li = $(`
  • Failed to restore ${name}
  • `); console.error(e); $list.append($li); + errored = true; }); })).then(() => { - $body.append("

    All values restored.

    "); + $body.append(`

    ${errored ? "Values restored with errors." : "All values restored."} Please check that all field values are as expected.

    `); }).catch(e => { $body.append(`

    Critical error restoring values

    ${e}

    `); }).finally(() => {