Skip to content

Commit

Permalink
fix(events): Added status after deleting files in idle
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Didenko committed Jun 28, 2024
1 parent 4fdf9a0 commit f62598d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion abstract/UploaderBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export class UploaderBlock extends ActivityBlock {
let errorItems = uploadCollection.findItems((entry) => {
return entry.getValue('errors').length > 0;
});
if (errorItems.length === 0 && uploadCollection.size === loadedItems.length) {
if (uploadCollection.size > 0 && errorItems.length === 0 && uploadCollection.size === loadedItems.length) {
this.emit(
EventType.COMMON_UPLOAD_SUCCESS,
/** @type {import('../types').OutputCollectionState<'success'>} */ (this.getOutputCollectionState()),
Expand Down
6 changes: 5 additions & 1 deletion abstract/buildOutputCollectionState.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export function buildOutputCollectionState(uploaderBlock) {
},

isSuccess: () => {
return state.errors.length === 0 && state.successEntries.length === state.allEntries.length;
return (
state.allEntries.length > 0 &&
state.errors.length === 0 &&
state.successEntries.length === state.allEntries.length
);
},

isUploading: () => {
Expand Down

0 comments on commit f62598d

Please sign in to comment.