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: Selecting yourself as the assignee should default Share somewhere to your self-DM #47291

Merged
merged 2 commits into from
Aug 14, 2024
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
7 changes: 7 additions & 0 deletions src/libs/actions/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@ function setAssigneeValue(
if (!shareToReportID && !skipShareDestination) {
setShareDestinationValue(report?.reportID ?? '-1');
}
} else {
Copy link
Contributor

@srikarparsi srikarparsi Aug 13, 2024

Choose a reason for hiding this comment

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

Can we flip the logic here so that it's cleaner?

if (isCurrentUser) {
...
} else {
...
}

Otherwise, this looks good to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srikarparsi i updated

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');
}
}

// This is only needed for creation of a new task and so it should only be stored locally
Expand Down
Loading