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: fix Thread related bugs #20691

Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,11 +645,11 @@ function hasAutomatedExpensifyAccountIDs(accountIDs) {
* Whether the time row should be shown for a report.
* @param {Array<Object>} personalDetails
* @param {Object} report
* @param {String} login
* @param {Number} accountID
* @return {Boolean}
*/
function canShowReportRecipientLocalTime(personalDetails, report, login) {
const reportParticipants = _.without(lodashGet(report, 'participantAccountIDs', []), login);
function canShowReportRecipientLocalTime(personalDetails, report, accountID) {
const reportParticipants = _.without(lodashGet(report, 'participantAccountIDs', []), accountID);
const participantsWithoutExpensifyAccountIDs = _.difference(reportParticipants, CONST.EXPENSIFY_ACCOUNT_IDS);
const hasMultipleParticipants = participantsWithoutExpensifyAccountIDs.length > 1;
const reportRecipient = personalDetails[participantsWithoutExpensifyAccountIDs[0]];
Expand Down
2 changes: 1 addition & 1 deletion src/libs/UserUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function getSmallSizeAvatar(avatarURL, accountID) {
* @returns {Number}
*/
function generateAccountID() {
return (Math.floor(Math.random() * 2 ** 21) * 2 ** 32 + Math.floor(Math.random() * 2 ** 32));
return Math.floor(Math.random() * 2 ** 21) * 2 ** 32 + Math.floor(Math.random() * 2 ** 32);
}

export {
Expand Down
7 changes: 5 additions & 2 deletions src/libs/actions/Task.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,11 @@ function reopenTask(taskReportID, taskTitle) {
* @param {object} report
* @param {string} ownerEmail
* @param {Number} ownerAccountID
* @param {{title?: string, description?: string, assignee?:string, assigneeAccountID?:number}} editedTask
* @returns {object} action
* @param {Object} editedTask
* @param {String} editedTask.title
* @param {String} editedTask.description
* @param {String} editedTask.assignee
* @param {Number} editedTask.assigneeAccountID
Comment on lines +295 to +299
Copy link
Contributor

Choose a reason for hiding this comment

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

Ooh i like this better, did lint recommend this or did you just fix it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lint was throwing out error on this, I fixed it (it would be cool if it did automatically 👀 )

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah right, i bet prettier could automatically write docs 🤔 maybe wishful thinking lol

*/
function editTaskAndNavigate(report, ownerEmail, ownerAccountID, {title, description, assignee, assigneeAccountID = 0}) {
// Create the EditedReportAction on the task
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ class ReportActionCompose extends React.Component {
const participantsWithoutExpensifyAccountIDs = _.difference(reportParticipants, CONST.EXPENSIFY_ACCOUNT_IDS);
const reportRecipient = this.props.personalDetails[participantsWithoutExpensifyAccountIDs[0]];
const shouldShowReportRecipientLocalTime =
ReportUtils.canShowReportRecipientLocalTime(this.props.personalDetails, this.props.report, this.props.currentUserPersonalDetails.login) && !this.props.isComposerFullSize;
ReportUtils.canShowReportRecipientLocalTime(this.props.personalDetails, this.props.report, this.props.currentUserPersonalDetails.accountID) && !this.props.isComposerFullSize;

// Prevents focusing and showing the keyboard while the drawer is covering the chat.
const isBlockedFromConcierge = ReportUtils.chatIncludesConcierge(this.props.report) && User.isBlockedFromConcierge(this.props.blockedFromConcierge);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const ReportActionsList = (props) => {
// Native mobile does not render updates flatlist the changes even though component did update called.
// To notify there something changes we can use extraData prop to flatlist
const extraData = [props.isSmallScreenWidth ? props.newMarkerReportActionID : undefined, ReportUtils.isArchivedRoom(props.report)];
const shouldShowReportRecipientLocalTime = ReportUtils.canShowReportRecipientLocalTime(props.personalDetailsList, props.report, props.currentUserPersonalDetails.login);
const shouldShowReportRecipientLocalTime = ReportUtils.canShowReportRecipientLocalTime(props.personalDetailsList, props.report, props.currentUserPersonalDetails.accountID);
return (
<Animated.View style={[animatedStyles, styles.flex1]}>
<InvertedFlatList
Expand Down