Skip to content

Commit 4fbbb26

Browse files
committed
Remove assigning current user as default attendee for no attendee transactions
1 parent 4589a01 commit 4fbbb26

2 files changed

Lines changed: 1 addition & 29 deletions

File tree

src/libs/OptionsListUtils.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,20 +2175,6 @@ function getAttendeeOptions(
21752175
'accountID',
21762176
);
21772177

2178-
const recentAttendeeHasCurrentUser = recentAttendees.find((attendee) => attendee.email === currentUserLogin || attendee.login === currentUserLogin);
2179-
if (!recentAttendeeHasCurrentUser && currentUserLogin) {
2180-
const details = getPersonalDetailByEmail(currentUserLogin);
2181-
recentAttendees.push({
2182-
email: currentUserLogin,
2183-
login: currentUserLogin,
2184-
displayName: details?.displayName ?? currentUserLogin,
2185-
accountID: currentUserAccountID,
2186-
text: details?.displayName ?? currentUserLogin,
2187-
searchText: details?.displayName ?? currentUserLogin,
2188-
avatarUrl: details?.avatarThumbnail ?? '',
2189-
});
2190-
}
2191-
21922178
const filteredRecentAttendees = recentAttendees
21932179
.filter((attendee) => !attendees.find(({email, displayName}) => (attendee.email ? email === attendee.email : displayName === attendee.displayName)))
21942180
.map((attendee) => ({

src/libs/TransactionUtils/index.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -728,21 +728,7 @@ function getMerchantOrDescription(transaction: OnyxEntry<Transaction>) {
728728
* Return the list of modified attendees if present otherwise list of attendees
729729
*/
730730
function getAttendees(transaction: OnyxInputOrEntry<Transaction>): Attendee[] {
731-
const attendees = transaction?.modifiedAttendees ? transaction.modifiedAttendees : (transaction?.comment?.attendees ?? []);
732-
if (attendees.length === 0) {
733-
const details = getPersonalDetailByEmail(currentUserEmail);
734-
attendees.push({
735-
email: currentUserEmail,
736-
login: details?.login ?? currentUserEmail,
737-
displayName: details?.displayName ?? currentUserEmail,
738-
accountID: currentUserAccountID,
739-
text: details?.displayName ?? currentUserEmail,
740-
searchText: details?.displayName ?? currentUserEmail,
741-
avatarUrl: details?.avatarThumbnail ?? '',
742-
selected: true,
743-
});
744-
}
745-
return attendees;
731+
return transaction?.modifiedAttendees ? transaction.modifiedAttendees : (transaction?.comment?.attendees ?? []);
746732
}
747733

748734
/**

0 commit comments

Comments
 (0)