Skip to content

Commit

Permalink
Merge pull request #4755 from mananjadhav/fix/hide-time-automated-acc…
Browse files Browse the repository at this point in the history
…ounts

Hide localtime for Expensify Emails (Automated Accounts)
  • Loading branch information
pecanoro authored Aug 24, 2021
2 parents 396e320 + 7aea6ba commit c005aac
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
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';
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 @@ -441,13 +442,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

0 comments on commit c005aac

Please sign in to comment.