@verdocs/web-sdk 6.5.0-beta.22 → 6.5.0-beta.23

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.
@@ -478,14 +478,14 @@ const VerdocsSign = class {
478
478
  sortFields(recipientFields);
479
479
  return recipientFields;
480
480
  }
481
- handleNext() {
481
+ async handleNext() {
482
482
  var _a;
483
483
  if (this.nextSubmits) {
484
484
  try {
485
485
  // Patches the date picker to be forcibly removed if still showing during submission
486
486
  (_a = document.getElementById('air-datepicker-global-container')) === null || _a === void 0 ? void 0 : _a.remove();
487
487
  this.submitting = true;
488
- const result = envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);
488
+ const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);
489
489
  console.log('[SIGN] Submitted successfully', result);
490
490
  // TODO: The "proper" way is generating an error from Stencil
491
491
  // NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which
@@ -494,6 +494,8 @@ const VerdocsSign = class {
494
494
  }
495
495
  catch (e) {
496
496
  console.log('[SIGN] Error submitting', e);
497
+ this.submitting = false;
498
+ VerdocsToast('Unable to submit document, please try again.', { style: 'error' });
497
499
  }
498
500
  return;
499
501
  }
@@ -965,22 +967,6 @@ const VerdocsSign = class {
965
967
  this.initialId = initResult.id;
966
968
  this.showSpinner = false;
967
969
  this.adoptingSignature = false;
968
- // If we have a focused field, we should auto-apply the new signature/initials to it
969
- if (this.focusedField) {
970
- const field = this.getRecipientFields().find(f => f.name === this.focusedField);
971
- if (field) {
972
- console.log('[SIGN] Auto-applying adopted signature to focused field', field.name);
973
- if (field.type === 'signature') {
974
- const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.signatureId, false);
975
- this.updateRecipientFieldValue(field.name, updateResult);
976
- }
977
- else if (field.type === 'initial') {
978
- const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.initialId, false);
979
- this.updateRecipientFieldValue(field.name, updateResult);
980
- }
981
- this.checkRecipientFields();
982
- }
983
- }
984
970
  }, onExit: () => (this.adoptingSignature = false) })), (this.submitting || this.showSpinner) && (h("verdocs-portal", null, h("div", { class: "spinner-overlay" }, h("verdocs-spinner", null)))), this.showDownloadDialog && (h("verdocs-download-dialog", { hasCertificate: (_b = (_a = this.envelope) === null || _a === void 0 ? void 0 : _a.documents) === null || _b === void 0 ? void 0 : _b.some(d => d.type === 'certificate'), onExit: () => (this.showDownloadDialog = false), onNext: async (e) => {
985
971
  this.showDownloadDialog = false;
986
972
  const { action } = e.detail;
@@ -994,15 +980,6 @@ const VerdocsSign = class {
994
980
  window.open(url, '_blank');
995
981
  }
996
982
  else {
997
- // If multiple docs, we might want to zip them or just download the first one for now as per previous logic?
998
- // The requirement says "Document", implies the PDF.
999
- // Users might have multiple files though.
1000
- // For now let's just do the zip of everything if multiple? Or loop?
1001
- // Let's stick to the previous behavior "firstDoc" strategy if we can't do better,
1002
- // or use getEnvelopeDocumentDownloadLink for each?
1003
- // Best user experience for "Document" if multiple is probably just the first one or a zip of docs.
1004
- // But "All Files" covers zip.
1005
- // Let's assume the main document is the primary intent.
1006
983
  const firstDoc = attachments[0];
1007
984
  if (firstDoc) {
1008
985
  const url = await getEnvelopeDocumentDownloadLink(this.endpoint, firstDoc.id);