Skip to content

Commit

Permalink
fix errors on closing external auth modal
Browse files Browse the repository at this point in the history
When processing a file it's removed from the queue, its state was lost
when re-added to the queue
  • Loading branch information
zsuffad committed Jan 14, 2025
1 parent 29c3196 commit a38c22b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/dbp-qualified-signature-pdf-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,6 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
`;
}




hasSignaturePermissions() {
return this._hasSignaturePermissions('ROLE_SCOPE_QUALIFIED-SIGNATURE');
}
Expand All @@ -468,11 +465,13 @@ class QualifiedSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitEle
this.signingProcessActive = false;

if (this.currentFile.file !== undefined) {
const key = await this.queueFile(this.currentFile.file);
// Re-queue file with the same key
const key = await this.reQueueFile(this.currentFile.file);

// set placement mode and parameters, so they are restore when canceled
// Set placement mode and parameters, so they are restore when canceled
this.queuedFilesPlacementModes[key] = this.currentFilePlacementMode;
this.queuedFilesSignaturePlacements[key] = this.currentFileSignaturePlacement;
this.setQueuedFilesTabulatorTable();
}
}

Expand Down
12 changes: 12 additions & 0 deletions src/dbp-signature-lit-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ export default class DBPSignatureLitElement extends BaseLitElement {
return key;
}

/**
* @param file
* @returns {Promise<string>} key of the re-queued item
*/
async reQueueFile(file) {
const key = String(this._queueKey);
this.queuedFiles[key] = new SignatureEntry(key, file);
this.updateQueuedFilesCount();

return key;
}

/**
* Takes a file off of the queue
*
Expand Down

0 comments on commit a38c22b

Please sign in to comment.