Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed UI crash on project page when task is creating in the project #8187

Merged
merged 4 commits into from
Jul 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions cvat-ui/src/components/project-page/project-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import notification from 'antd/lib/notification';
import { getCore, Project, Task } from 'cvat-core-wrapper';
import { CombinedState, Indexable } from 'reducers';
import { getProjectTasksAsync } from 'actions/projects-actions';
import { cancelInferenceAsync } from 'actions/models-actions';
import CVATLoadingSpinner from 'components/common/loading-spinner';
import TaskItem from 'components/tasks-page/task-item';
import TaskItem from 'containers/tasks-page/task-item';
import MoveTaskModal from 'components/move-task-modal/move-task-modal';
import ModelRunnerDialog from 'components/model-runner-modal/model-runner-dialog';
import {
Expand Down Expand Up @@ -60,10 +59,7 @@ export default function ProjectPageComponent(): JSX.Element {
const [updatingProject, setUpdatingProject] = useState(false);
const mounted = useRef(false);

const ribbonPlugins = useSelector((state: CombinedState) => state.plugins.components.taskItem.ribbon);
const deletes = useSelector((state: CombinedState) => state.projects.activities.deletes);
const taskDeletes = useSelector((state: CombinedState) => state.tasks.activities.deletes);
const tasksActiveInferences = useSelector((state: CombinedState) => state.models.inferences);
const tasks = useSelector((state: CombinedState) => state.tasks.current);
const tasksCount = useSelector((state: CombinedState) => state.tasks.count);
const tasksQuery = useSelector((state: CombinedState) => state.projects.tasksGettingQuery);
Expand Down Expand Up @@ -153,14 +149,8 @@ export default function ProjectPageComponent(): JSX.Element {
.map((task: Task) => (
<TaskItem
key={task.id}
ribbonPlugins={ribbonPlugins}
deleted={task.id in taskDeletes ? taskDeletes[task.id] : false}
hidden={false}
activeInference={tasksActiveInferences[task.id] || null}
cancelAutoAnnotation={() => {
dispatch(cancelInferenceAsync(task.id));
}}
taskInstance={task}
taskID={task.id}
idx={tasks.indexOf(task)}
/>
))}
</React.Fragment>
Expand Down
Loading