refactor(enhanced-kanban): simplify task creation event handling
- Updated the event handler in EnhancedKanbanCreateTaskCard to clarify that the form reset is separate from the global task addition to Redux, improving code readability and maintainability.
This commit is contained in:
@@ -89,7 +89,7 @@ const EnhancedKanbanCreateTaskCard: React.FC<EnhancedKanbanCreateTaskCardProps>
|
||||
|
||||
// Real-time socket event handler
|
||||
const eventHandler = (task: IProjectTask) => {
|
||||
dispatch(addTaskToGroup({ sectionId, task: { ...task, id: task.id || nanoid(), name: task.name || newTaskName.trim() } }));
|
||||
// Only reset the form - the global handler will add the task to Redux
|
||||
socket?.off(SocketEvents.QUICK_TASK.toString(), eventHandler);
|
||||
resetForNextTask();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user