Skip to content

Commit

Permalink
Remove tasks by projectId from state after deleting project (#7854)
Browse files Browse the repository at this point in the history
  • Loading branch information
novda committed May 9, 2024
1 parent 600e94f commit 899735d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cvat-ui/src/reducers/tasks-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { BoundariesActionTypes } from 'actions/boundaries-actions';
import { TasksActionTypes } from 'actions/tasks-actions';
import { AuthActionTypes } from 'actions/auth-actions';

import { ProjectsActionTypes } from 'actions/projects-actions';
import { TasksState } from '.';

const defaultState: TasksState = {
Expand Down Expand Up @@ -77,6 +78,13 @@ export default (state: TasksState = defaultState, action: AnyAction): TasksState
initialized: true,
fetching: false,
};
case ProjectsActionTypes.DELETE_PROJECT_SUCCESS: {
const { projectId } = action.payload;
return {
...state,
current: state.current.filter((_task) => _task.projectId !== projectId),
};
}
case TasksActionTypes.DELETE_TASK: {
const { taskID } = action.payload;
const { deletes } = state.activities;
Expand Down

0 comments on commit 899735d

Please sign in to comment.