@formio/js 5.0.0-dev.5584.9c8ee6a → 5.0.0-dev.5593.4f4b210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -291,12 +291,19 @@ class Webform extends NestedDataComponent_1.default {
291
291
  // Set language after everything is established.
292
292
  this.language = this.i18next.language;
293
293
  // See if we need to restore the draft from a user.
294
- if (this.options.saveDraft && !this.options.skipDraftRestore) {
294
+ if (this.options.saveDraft) {
295
295
  this.formReady.then(() => {
296
- const user = Formio_1.Formio.getUser();
297
- // Only restore a draft if the submission isn't explicitly set.
298
- if (user && !this.submissionSet) {
299
- this.restoreDraft(user._id);
296
+ if (!this.options.skipDraftRestore) {
297
+ const user = Formio_1.Formio.getUser();
298
+ // Only restore a draft if the submission isn't explicitly set.
299
+ if (user && !this.submissionSet) {
300
+ this.restoreDraft(user._id);
301
+ }
302
+ }
303
+ else {
304
+ // Enable drafts
305
+ this.draftEnabled = true;
306
+ this.savingDraft = false;
300
307
  }
301
308
  });
302
309
  }
@@ -263,12 +263,19 @@ export default class Webform extends NestedDataComponent {
263
263
  // Set language after everything is established.
264
264
  this.language = this.i18next.language;
265
265
  // See if we need to restore the draft from a user.
266
- if (this.options.saveDraft && !this.options.skipDraftRestore) {
266
+ if (this.options.saveDraft) {
267
267
  this.formReady.then(() => {
268
- const user = Formio.getUser();
269
- // Only restore a draft if the submission isn't explicitly set.
270
- if (user && !this.submissionSet) {
271
- this.restoreDraft(user._id);
268
+ if (!this.options.skipDraftRestore) {
269
+ const user = Formio.getUser();
270
+ // Only restore a draft if the submission isn't explicitly set.
271
+ if (user && !this.submissionSet) {
272
+ this.restoreDraft(user._id);
273
+ }
274
+ }
275
+ else {
276
+ // Enable drafts
277
+ this.draftEnabled = true;
278
+ this.savingDraft = false;
272
279
  }
273
280
  });
274
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.0.0-dev.5584.9c8ee6a",
3
+ "version": "5.0.0-dev.5593.4f4b210",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {