Skip to content

Commit

Permalink
Merge pull request Expensify#47291 from nkdengineer/fix/46918
Browse files Browse the repository at this point in the history
fix: Selecting yourself as the assignee should default Share somewhere to your self-DM
  • Loading branch information
srikarparsi authored Aug 14, 2024
2 parents b7d4e5b + 1530104 commit b7f7f1b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libs/actions/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,14 @@ function setAssigneeValue(
skipShareDestination = false,
): OnyxEntry<OnyxTypes.Report> | undefined {
let report: OnyxEntry<OnyxTypes.Report> | undefined = chatReport;
if (!isCurrentUser) {
if (isCurrentUser) {
const selfDMReportID = ReportUtils.findSelfDMReportID();
// If there is no share destination set, automatically set it to the assignee chat report
// This allows for a much quicker process when creating a new task and is likely the desired share destination most times
if (!shareToReportID && !skipShareDestination) {
setShareDestinationValue(selfDMReportID ?? '-1');
}
} else {
// Check for the chatReport by participants IDs
if (!report) {
report = ReportUtils.getChatByParticipants([assigneeAccountID, currentUserAccountID]);
Expand Down

0 comments on commit b7f7f1b

Please sign in to comment.