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

Fix user cannot remove the description #20544

Merged
merged 6 commits into from
Jun 12, 2023
Merged
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import ROUTES from '../../ROUTES';
import CONST from '../../CONST';
import DateUtils from '../DateUtils';
import * as UserUtils from '../UserUtils';
import _ from 'underscore';

/**
* Clears out the task info from the store
Expand Down Expand Up @@ -311,7 +312,7 @@ function editTaskAndNavigate(report, ownerEmail, {title, description, assignee})
key: `${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`,
value: {
reportName,
description: (description !== undefined ? description : report.description).trim(),
description: (!_.isUndefined(description) ? description : report.description).trim(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dukenv0307 Can we follow DRY code here , should be extracted at the top below line 292

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fedirjh I updated.

managerEmail: assignee || report.managerEmail,
},
},
Expand Down Expand Up @@ -366,7 +367,7 @@ function editTaskAndNavigate(report, ownerEmail, {title, description, assignee})
{
taskReportID: report.reportID,
title: reportName,
description: (description !== undefined ? description : report.description).trim(),
description: (!_.isUndefined(description) ? description : report.description).trim(),
assignee: assignee || report.managerEmail,
editedTaskReportActionID: editTaskReportAction.reportActionID,
assigneeChatReportActionID: optimisticAssigneeAddComment ? optimisticAssigneeAddComment.reportAction.reportActionID : 0,
Expand Down