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

Hide localtime for Expensify Emails (Automated Accounts) #4755

Merged
merged 3 commits into from
Aug 24, 2021
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
16 changes: 16 additions & 0 deletions src/CONST.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/pages/home/report/ReportActionCompose.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {withNavigationFocus} from '@react-navigation/compat';
import _ from 'underscore';
import lodashGet from 'lodash/get';
import {withOnyx} from 'react-native-onyx';
import lodashIntersection from 'lodash/intersection';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a huge deal, but I think we prefer using underscore over new lodash methods.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have any current PR related to any related module. I'll raise a separate PR to address this sometime tomorrow.

import styles, {getButtonBackgroundColorStyle, getIconFillColor} from '../../../styles/styles';
import themeColors from '../../../styles/themes/default';
import TextInputFocusable from '../../../components/TextInputFocusable';
Expand Down Expand Up @@ -41,7 +42,7 @@ import EmojiPickerMenu from './EmojiPickerMenu';
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
import withDrawerState from '../../../components/withDrawerState';
import getButtonState from '../../../libs/getButtonState';
import CONST from '../../../CONST';
import CONST, {EXPENSIFY_EMAILS} from '../../../CONST';
import canFocusInputOnScreenFocus from '../../../libs/canFocusInputOnScreenFocus';
import variables from '../../../styles/variables';
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
Expand Down Expand Up @@ -432,13 +433,12 @@ class ReportActionCompose extends React.Component {
// eslint-disable-next-line no-unused-vars
const reportParticipants = lodashGet(this.props.report, 'participants', []);
const hasMultipleParticipants = reportParticipants.length > 1;
const hasChronosParticipant = _.contains(reportParticipants, CONST.EMAIL.CHRONOS);
const hasExpensifyEmails = lodashIntersection(reportParticipants, EXPENSIFY_EMAILS).length > 0;
const hasConciergeParticipant = _.contains(reportParticipants, CONST.EMAIL.CONCIERGE);
const reportRecipient = this.props.personalDetails[reportParticipants[0]];
const currentUserTimezone = lodashGet(this.props.myPersonalDetails, 'timezone', CONST.DEFAULT_TIME_ZONE);
const reportRecipientTimezone = lodashGet(reportRecipient, 'timezone', CONST.DEFAULT_TIME_ZONE);
const shouldShowReportRecipientLocalTime = !hasConciergeParticipant
&& !hasChronosParticipant
const shouldShowReportRecipientLocalTime = !hasExpensifyEmails
&& !hasMultipleParticipants
&& reportRecipient
&& reportRecipientTimezone
Expand Down