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

Personal details list migration: use accountID (number) in setContactMethodAsDefault #20792

Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions src/libs/actions/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ function setContactMethodAsDefault(newDefaultContactMethod) {
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: {
[newDefaultContactMethod]: {
[currentUserAccountID]: {
...myPersonalDetails,
login: newDefaultContactMethod,
displayName: PersonalDetails.getDisplayName(newDefaultContactMethod, myPersonalDetails),
Expand Down Expand Up @@ -835,8 +835,7 @@ function setContactMethodAsDefault(newDefaultContactMethod) {
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
value: {
[newDefaultContactMethod]: null,
[oldDefaultContactMethod]: {...myPersonalDetails},
[currentUserAccountID]: {...myPersonalDetails},
},
},
];
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReactionList/PopoverReactionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class PopoverReactionList extends React.Component {
};
}
const emojiCount = selectedReaction.users.length;
const reactionUsers = _.map(selectedReaction.users, (sender) => sender.accountID.toString());
const reactionUsers = _.map(selectedReaction.users, (sender) => sender.accountID);
const emoji = _.find(emojis, (e) => e.name === selectedReaction.emoji);
const emojiCodes = EmojiUtils.getUniqueEmojiCodes(emoji, selectedReaction.users);
const hasUserReacted = Report.hasAccountIDReacted(this.props.currentUserPersonalDetails.accountID, reactionUsers);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oofda - Report.hasAccountIDReacted is checking that accountIDs equal each other by converting accountIDs to strings (probably why we had .toString() above before - can we update that function to treat userAccountIDs as numbers? 🙏

Unless you think that has the potential to cause bigger problems...

Copy link
Contributor Author

@BeeMargarida BeeMargarida Jun 15, 2023

Choose a reason for hiding this comment

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

Done, I think this also fixed the tooltips content

Expand Down