Skip to content

Commit c005aac

Browse files
authored
Merge pull request #4755 from mananjadhav/fix/hide-time-automated-accounts
Hide localtime for Expensify Emails (Automated Accounts)
2 parents 396e320 + 7aea6ba commit c005aac

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/CONST.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pages/home/report/ReportActionCompose.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {withNavigationFocus} from '@react-navigation/compat';
1111
import _ from 'underscore';
1212
import lodashGet from 'lodash/get';
1313
import {withOnyx} from 'react-native-onyx';
14+
import lodashIntersection from 'lodash/intersection';
1415
import styles, {getButtonBackgroundColorStyle, getIconFillColor} from '../../../styles/styles';
1516
import themeColors from '../../../styles/themes/default';
1617
import TextInputFocusable from '../../../components/TextInputFocusable';
@@ -41,7 +42,7 @@ import EmojiPickerMenu from './EmojiPickerMenu';
4142
import withWindowDimensions, {windowDimensionsPropTypes} from '../../../components/withWindowDimensions';
4243
import withDrawerState from '../../../components/withDrawerState';
4344
import getButtonState from '../../../libs/getButtonState';
44-
import CONST from '../../../CONST';
45+
import CONST, {EXPENSIFY_EMAILS} from '../../../CONST';
4546
import canFocusInputOnScreenFocus from '../../../libs/canFocusInputOnScreenFocus';
4647
import variables from '../../../styles/variables';
4748
import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize';
@@ -441,13 +442,12 @@ class ReportActionCompose extends React.Component {
441442
// eslint-disable-next-line no-unused-vars
442443
const reportParticipants = lodashGet(this.props.report, 'participants', []);
443444
const hasMultipleParticipants = reportParticipants.length > 1;
444-
const hasChronosParticipant = _.contains(reportParticipants, CONST.EMAIL.CHRONOS);
445+
const hasExpensifyEmails = lodashIntersection(reportParticipants, EXPENSIFY_EMAILS).length > 0;
445446
const hasConciergeParticipant = _.contains(reportParticipants, CONST.EMAIL.CONCIERGE);
446447
const reportRecipient = this.props.personalDetails[reportParticipants[0]];
447448
const currentUserTimezone = lodashGet(this.props.myPersonalDetails, 'timezone', CONST.DEFAULT_TIME_ZONE);
448449
const reportRecipientTimezone = lodashGet(reportRecipient, 'timezone', CONST.DEFAULT_TIME_ZONE);
449-
const shouldShowReportRecipientLocalTime = !hasConciergeParticipant
450-
&& !hasChronosParticipant
450+
const shouldShowReportRecipientLocalTime = !hasExpensifyEmails
451451
&& !hasMultipleParticipants
452452
&& reportRecipient
453453
&& reportRecipientTimezone

0 commit comments

Comments
 (0)