Skip to content

Commit

Permalink
Disable assigning users who do not yet exist to tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Aug 23, 2023
1 parent 1cff304 commit f8966bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ function getOptions(
includeMoneyRequests = false,
excludeUnknownUsers = false,
includeP2P = true,
canInviteUser = true,
},
) {
if (!isPersonalDetailsReady(personalDetails)) {
Expand Down Expand Up @@ -874,7 +875,7 @@ function getOptions(
return {
personalDetails: personalDetailsOptions,
recentReports: recentReportOptions,
userToInvite,
userToInvite: canInviteUser ? userToInvite : null,
currentUserOption,
};
}
Expand Down Expand Up @@ -959,7 +960,7 @@ function getIOUConfirmationOptionsFromParticipants(participants, amountText) {
* @param {boolean} [includeP2P]
* @returns {Object}
*/
function getNewChatOptions(reports, personalDetails, betas = [], searchValue = '', selectedOptions = [], excludeLogins = [], includeOwnedWorkspaceChats = false, includeP2P = true) {
function getNewChatOptions(reports, personalDetails, betas = [], searchValue = '', selectedOptions = [], excludeLogins = [], includeOwnedWorkspaceChats = false, includeP2P = true, canInviteUser = true) {
return getOptions(reports, personalDetails, {
betas,
searchInputValue: searchValue.trim(),
Expand All @@ -970,6 +971,7 @@ function getNewChatOptions(reports, personalDetails, betas = [], searchValue = '
excludeLogins,
includeOwnedWorkspaceChats,
includeP2P,
canInviteUser,
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/pages/tasks/TaskAssigneeSelectorModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ function TaskAssigneeSelectorModal(props) {
[],
CONST.EXPENSIFY_EMAILS,
false,
true,
false,
);

setHeaderMessage(OptionsListUtils.getHeaderMessage(recentReports?.length + personalDetails?.length !== 0 || currentUserOption, Boolean(userToInvite), searchValue));
Expand Down

0 comments on commit f8966bb

Please sign in to comment.