Skip to content

Commit

Permalink
rename the function
Browse files Browse the repository at this point in the history
  • Loading branch information
nkdengineer committed May 6, 2024
1 parent 9d27230 commit 16282bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/libs/actions/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ function setAssigneeChatReport(chatReport: OnyxTypes.Report) {
Onyx.merge(ONYXKEYS.TASK, {assigneeChatReport: chatReport});
}

function setOptimisticDataForNewAssingee(assigneeLogin: string, assigneeAccountID: number | undefined = undefined) {
function setNewOptimisticAssignee(assigneeLogin: string, assigneeAccountID: number | undefined = undefined) {
const currentAssigneeAccountID = assigneeAccountID ?? UserUtils.generateAccountID(assigneeLogin);
const report: ReportUtils.OptimisticChatReport = ReportUtils.buildOptimisticChatReport([currentAssigneeAccountID]);

Expand Down Expand Up @@ -691,7 +691,7 @@ function setAssigneeValue(
}
// If chat report is still not found we need to build new optimistic chat report
if (!report) {
report = setOptimisticDataForNewAssingee(assigneeEmail, assigneeAccountID).assigneeReport;
report = setNewOptimisticAssignee(assigneeEmail, assigneeAccountID).assigneeReport;
}

// The optimistic field may not exist in the existing report and it can be overridden by the optimistic field of previous report data when merging the assignee chat report
Expand Down Expand Up @@ -1053,7 +1053,7 @@ export {
getTaskAssigneeAccountID,
clearTaskErrors,
canModifyTask,
setOptimisticDataForNewAssingee,
setNewOptimisticAssignee,
};

export type {PolicyValue, Assignee, ShareDestination};
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function ReportFooter({
if (mentionWithDomain) {
assignee = Object.values(allPersonalDetails).find((value) => value?.login === mentionWithDomain) ?? {};
if (!Object.keys(assignee).length) {
const optimisticDataForNewAssignee = Task.setOptimisticDataForNewAssingee(mentionWithDomain);
const optimisticDataForNewAssignee = Task.setNewOptimisticAssignee(mentionWithDomain);
assignee = optimisticDataForNewAssignee.assignee;
assigneeChatReport = optimisticDataForNewAssignee.assigneeReport;
}
Expand Down

0 comments on commit 16282bd

Please sign in to comment.