Skip to content

Commit

Permalink
Merge branch 'develop' into bs/open_guide_automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev authored Feb 1, 2024
2 parents 2d88b6c + bdd002a commit c8a4582
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 9 additions & 5 deletions cvat-ui/src/components/tasks-page/task-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,16 @@ class TaskItemComponent extends React.PureComponent<TaskItemProps & RouteCompone
}).then((createdTask: Task) => {
if (!this.#isUnmounted) {
this.setState({ importingState: null });

setTimeout(() => {
const { taskInstance: currentTaskInstance } = this.props;
if (currentTaskInstance.size !== createdTask.size) {
// update state only if it was not updated anywhere else
// for example in createTaskAsync
updateTaskInState(createdTask);
if (!this.#isUnmounted) {
// check again, because the component may be unmounted to this moment
const { taskInstance: currentTaskInstance } = this.props;
if (currentTaskInstance.size !== createdTask.size) {
// update state only if it was not updated anywhere else
// for example in createTaskAsync
updateTaskInState(createdTask);
}
}
}, 1000);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ context('Create more than one task per time when create from project.', () => {
cy.get('.cvat-constructor-viewer-new-item').should('not.exist');
cy.get('input[type="file"]').attachFile(archiveName, { subjectType: 'drag-n-drop' });
cy.contains('button', 'Submit & Continue').click();
cy.get('.cvat-notification-create-task-success').should('exist');
cy.get('.cvat-notification-create-task-success').should('exist').within(() => {
cy.get('.anticon-close').click();
});
cy.get('.cvat-notification-create-task-fail').should('not.exist');
}

Expand Down

0 comments on commit c8a4582

Please sign in to comment.