Skip to content

Commit

Permalink
Merge pull request #23243 from dukenv0307/revert-22983-fix/22078
Browse files Browse the repository at this point in the history
Revert "fix: The title field is cleared when the Confirm task button is pressed"
  • Loading branch information
yuwenmemon authored Jul 20, 2023
2 parents be2c81f + ebfa41b commit d774940
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ function createTaskAndNavigate(parentReportID, title, description, assignee, ass
{optimisticData, successData, failureData},
);

clearOutTaskInfo();

Navigation.dismissModal(optimisticTaskReport.reportID);
}

Expand Down
12 changes: 0 additions & 12 deletions src/pages/tasks/NewTaskPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ function NewTaskPage(props) {
const [shareDestination, setShareDestination] = React.useState({});
const [errorMessage, setErrorMessage] = React.useState('');
const [parentReport, setParentReport] = React.useState({});
const shouldClearOutTaskInfoOnUnmount = React.useRef(false);

const isAllowedToCreateTask = useMemo(() => _.isEmpty(parentReport) || ReportUtils.isAllowedToComment(parentReport), [parentReport]);

Expand Down Expand Up @@ -102,16 +101,6 @@ function NewTaskPage(props) {
}
}, [props]);

useEffect(
() => () => {
if (!shouldClearOutTaskInfoOnUnmount.current) {
return;
}
Task.clearOutTaskInfo();
},
[],
);

// On submit, we want to call the createTask function and wait to validate
// the response
function onSubmit() {
Expand All @@ -130,7 +119,6 @@ function NewTaskPage(props) {
return;
}

shouldClearOutTaskInfoOnUnmount.current = true;
Task.createTaskAndNavigate(parentReport.reportID, props.task.title, props.task.description, props.task.assignee, props.task.assigneeAccountID);
}

Expand Down

0 comments on commit d774940

Please sign in to comment.