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

Revert "fix: The title field is cleared when the Confirm task button is pressed" #23243

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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