Skip to content

Commit

Permalink
feat(lr-upload-ctx-provider): add method removeFileByInternalId (#618)
Browse files Browse the repository at this point in the history
Co-authored-by: nd0ut <[email protected]>
  • Loading branch information
nd0ut and nd0ut authored Feb 29, 2024
1 parent f73a5c8 commit c2492eb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions abstract/UploaderBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,14 @@ export class UploaderBlock extends ActivityBlock {
});
}

/** @param {string} internalId */
removeFileByInternalId(internalId) {
if (!this.uploadCollection.read(internalId)) {
throw new Error(`File with internalId ${internalId} not found`);
}
this.uploadCollection.remove(internalId);
}

uploadAll = () => {
const itemsToUpload = this.uploadCollection.items().filter((id) => {
const entry = this.uploadCollection.read(id);
Expand Down

0 comments on commit c2492eb

Please sign in to comment.