Skip to content

Commit

Permalink
Fixes #200: collaborative projects
Browse files Browse the repository at this point in the history
  • Loading branch information
hussaino03 committed Dec 29, 2024
1 parent d1b38f7 commit fdaab3d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion client/src/components/Modal Management/Tasks/TaskForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,25 @@ const TaskForm = ({ addTask }) => {
return;
}

// Handle urgent label
let finalLabel = formState.label;
if (formState.urgent) {
if (!finalLabel) {
finalLabel = 'urgent';
} else if (!finalLabel.toLowerCase().includes('urgent')) {
const urgentSuffix = ' | urgent';
finalLabel = (finalLabel + urgentSuffix).slice(0, MAX_LABEL_LENGTH);
}
}

const newTask = {
name: formState.name,
desc: formState.description,
difficulty: formState.difficulty,
importance: formState.importance,
deadline: formState.deadline || null,
urgent: formState.urgent,
label: formState.label || null,
label: finalLabel,
experience: calculateBaseXP(
formState.difficulty,
formState.importance,
Expand Down

0 comments on commit fdaab3d

Please sign in to comment.