From 9f7dd2a0d3f56dc054601875c043af22fdfb654d Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Thu, 9 Nov 2023 17:05:34 +0100 Subject: [PATCH 01/11] Migrate 'FormSubmit' component to TypeScript --- .../FormSubmit/formSubmitPropTypes.js | 27 ---------- src/components/FormSubmit/index.native.js | 18 ------- src/components/FormSubmit/index.native.tsx | 18 +++++++ .../FormSubmit/{index.js => index.tsx} | 49 +++++++++---------- src/components/FormSubmit/types.ts | 12 +++++ .../isEnterWhileComposition.ts | 3 +- 6 files changed, 55 insertions(+), 72 deletions(-) delete mode 100644 src/components/FormSubmit/formSubmitPropTypes.js delete mode 100644 src/components/FormSubmit/index.native.js create mode 100644 src/components/FormSubmit/index.native.tsx rename src/components/FormSubmit/{index.js => index.tsx} (65%) create mode 100644 src/components/FormSubmit/types.ts diff --git a/src/components/FormSubmit/formSubmitPropTypes.js b/src/components/FormSubmit/formSubmitPropTypes.js deleted file mode 100644 index 306b3544cc11..000000000000 --- a/src/components/FormSubmit/formSubmitPropTypes.js +++ /dev/null @@ -1,27 +0,0 @@ -import PropTypes from 'prop-types'; -import stylePropTypes from '@styles/stylePropTypes'; - -const propTypes = { - /** A reference forwarded to the inner View */ - innerRef: PropTypes.oneOfType([ - PropTypes.func, - // eslint-disable-next-line react/forbid-prop-types - PropTypes.shape({current: PropTypes.any}), - ]), - - /* A function to execute when form is submitted with ENTER */ - onSubmit: PropTypes.func.isRequired, - - /** Children to wrap with FormSubmit. */ - children: PropTypes.node.isRequired, - - /** Container styles */ - style: stylePropTypes, -}; - -const defaultProps = { - innerRef: undefined, - style: [], -}; - -export {propTypes, defaultProps}; diff --git a/src/components/FormSubmit/index.native.js b/src/components/FormSubmit/index.native.js deleted file mode 100644 index 29a8678695d5..000000000000 --- a/src/components/FormSubmit/index.native.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import {View} from 'react-native'; -import * as formSubmitPropTypes from './formSubmitPropTypes'; - -const FormSubmit = React.forwardRef((props, ref) => ( - - {props.children} - -)); - -FormSubmit.propTypes = formSubmitPropTypes.propTypes; -FormSubmit.defaultProps = formSubmitPropTypes.defaultProps; -FormSubmit.displayName = 'FormSubmit'; - -export default FormSubmit; diff --git a/src/components/FormSubmit/index.native.tsx b/src/components/FormSubmit/index.native.tsx new file mode 100644 index 000000000000..22bf5353949d --- /dev/null +++ b/src/components/FormSubmit/index.native.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import {View} from 'react-native'; +import {FormSubmitProps, FormSubmitRef} from './types'; + +function FormSubmit({style, children}: FormSubmitProps, ref: FormSubmitRef) { + return ( + + {children} + + ); +} + +FormSubmit.displayName = 'FormSubmit'; + +export default React.forwardRef(FormSubmit); diff --git a/src/components/FormSubmit/index.js b/src/components/FormSubmit/index.tsx similarity index 65% rename from src/components/FormSubmit/index.js rename to src/components/FormSubmit/index.tsx index a4e9e960291c..22b943dfea13 100644 --- a/src/components/FormSubmit/index.js +++ b/src/components/FormSubmit/index.tsx @@ -1,23 +1,23 @@ -import lodashGet from 'lodash/get'; -import React, {useEffect} from 'react'; +import React, {KeyboardEvent as ReactKeyboardEvent, useEffect} from 'react'; import {View} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; import isEnterWhileComposition from '@libs/KeyboardShortcut/isEnterWhileComposition'; import CONST from '@src/CONST'; -import * as formSubmitPropTypes from './formSubmitPropTypes'; +import {FormSubmitProps, FormSubmitRef} from './types'; -function FormSubmit({innerRef, children, onSubmit, style}) { +function FormSubmit({children, onSubmit, style}: FormSubmitProps, ref: FormSubmitRef) { /** * Calls the submit callback when ENTER is pressed on a form element. - * @param {Object} event */ - const submitForm = (event) => { + const submitForm = (event: ReactKeyboardEvent) => { // ENTER is pressed with modifier key or during text composition, do not submit the form if (event.shiftKey || event.key !== CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey || isEnterWhileComposition(event)) { return; } - const tagName = lodashGet(event, 'target.tagName', ''); + const eventTarget = event.target as HTMLElement; + + const tagName = eventTarget?.tagName ?? ''; // ENTER is pressed on INPUT or SELECT element, call the submit callback. if (tagName === 'INPUT' || tagName === 'SELECT') { @@ -26,22 +26,30 @@ function FormSubmit({innerRef, children, onSubmit, style}) { } // Pressing Enter on TEXTAREA element adds a new line. When `dataset.submitOnEnter` prop is passed, call the submit callback. - if (tagName === 'TEXTAREA' && lodashGet(event, 'target.dataset.submitOnEnter', 'false') === 'true') { + if (tagName === 'TEXTAREA' && (eventTarget?.dataset?.submitOnEnter ?? 'false') === 'true') { event.preventDefault(); onSubmit(); return; } // ENTER is pressed on checkbox element, call the submit callback. - if (lodashGet(event, 'target.role') === 'checkbox') { + if (eventTarget?.role === 'checkbox') { onSubmit(); } }; - const preventDefaultFormBehavior = (e) => e.preventDefault(); + const preventDefaultFormBehavior = (e: SubmitEvent) => e.preventDefault(); useEffect(() => { - const form = innerRef.current; + if (!(ref && 'current' in ref)) { + return; + } + + const form = ref.current as HTMLFormElement | null; + + if (!form) { + return; + } // Prevent the browser from applying its own validation, which affects the email input form.setAttribute('novalidate', ''); @@ -55,7 +63,7 @@ function FormSubmit({innerRef, children, onSubmit, style}) { form.removeEventListener('submit', preventDefaultFormBehavior); }; - }, [innerRef]); + }, [ref]); return ( // React-native-web prevents event bubbling on TextInput for key presses @@ -63,7 +71,7 @@ function FormSubmit({innerRef, children, onSubmit, style}) { // Thus use capture phase. @@ -72,17 +80,6 @@ function FormSubmit({innerRef, children, onSubmit, style}) { ); } -FormSubmit.propTypes = formSubmitPropTypes.propTypes; -FormSubmit.defaultProps = formSubmitPropTypes.defaultProps; - -const FormSubmitWithRef = React.forwardRef((props, ref) => ( - -)); - -FormSubmitWithRef.displayName = 'FormSubmitWithRef'; +FormSubmit.displayName = 'FormSubmitWithRef'; -export default FormSubmitWithRef; +export default React.forwardRef(FormSubmit); diff --git a/src/components/FormSubmit/types.ts b/src/components/FormSubmit/types.ts new file mode 100644 index 000000000000..20910647ecb8 --- /dev/null +++ b/src/components/FormSubmit/types.ts @@ -0,0 +1,12 @@ +import React, {ForwardedRef} from 'react'; +import {StyleProp, View, ViewStyle} from 'react-native'; + +type FormSubmitProps = { + children: React.ReactNode; + onSubmit: () => void; + style?: StyleProp; +}; + +type FormSubmitRef = ForwardedRef; + +export type {FormSubmitProps, FormSubmitRef}; diff --git a/src/libs/KeyboardShortcut/isEnterWhileComposition.ts b/src/libs/KeyboardShortcut/isEnterWhileComposition.ts index 51e198f1c2d1..a752f8a24811 100644 --- a/src/libs/KeyboardShortcut/isEnterWhileComposition.ts +++ b/src/libs/KeyboardShortcut/isEnterWhileComposition.ts @@ -1,3 +1,4 @@ +import React from 'react'; import {NativeSyntheticEvent} from 'react-native'; import * as Browser from '@libs/Browser'; import CONST from '@src/CONST'; @@ -6,7 +7,7 @@ import CONST from '@src/CONST'; * Check if the Enter key was pressed during IME confirmation (i.e. while the text is being composed). * See {@link https://en.wikipedia.org/wiki/Input_method} */ -const isEnterWhileComposition = (event: KeyboardEvent): boolean => { +const isEnterWhileComposition = (event: KeyboardEvent | React.KeyboardEvent): boolean => { // if on mobile chrome, the enter key event is never fired when the enter key is pressed while composition. if (Browser.isMobileChrome()) { return false; From 7e4b19bf000245b5f5c11a3061b16621e0606355 Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Tue, 14 Nov 2023 18:07:48 +0100 Subject: [PATCH 02/11] revert KeyboardEvent naming --- src/components/FormSubmit/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FormSubmit/index.tsx b/src/components/FormSubmit/index.tsx index 22b943dfea13..ef3f3c39bbaa 100644 --- a/src/components/FormSubmit/index.tsx +++ b/src/components/FormSubmit/index.tsx @@ -1,4 +1,4 @@ -import React, {KeyboardEvent as ReactKeyboardEvent, useEffect} from 'react'; +import React, {KeyboardEvent, useEffect} from 'react'; import {View} from 'react-native'; import * as ComponentUtils from '@libs/ComponentUtils'; import isEnterWhileComposition from '@libs/KeyboardShortcut/isEnterWhileComposition'; @@ -9,7 +9,7 @@ function FormSubmit({children, onSubmit, style}: FormSubmitProps, ref: FormSubmi /** * Calls the submit callback when ENTER is pressed on a form element. */ - const submitForm = (event: ReactKeyboardEvent) => { + const submitForm = (event: KeyboardEvent) => { // ENTER is pressed with modifier key or during text composition, do not submit the form if (event.shiftKey || event.key !== CONST.KEYBOARD_SHORTCUTS.ENTER.shortcutKey || isEnterWhileComposition(event)) { return; From cd1204fb048af96f7f540d766255722269382505 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 15:07:34 +0100 Subject: [PATCH 03/11] exclude notificatiosn from cht search --- src/CONST.ts | 2 ++ src/libs/OptionsListUtils.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 13b79179f431..af254a40b090 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -963,6 +963,7 @@ const CONST = { GUIDES_DOMAIN: 'team.expensify.com', HELP: 'help@expensify.com', INTEGRATION_TESTING_CREDS: 'integrationtestingcreds@expensify.com', + NOTIFICATIONS: 'notifications@expensify.com', PAYROLL: 'payroll@expensify.com', QA: 'qa@expensify.com', QA_TRAVIS: 'qa+travisreceipts@expensify.com', @@ -1408,6 +1409,7 @@ const CONST = { this.EMAIL.FIRST_RESPONDER, this.EMAIL.HELP, this.EMAIL.INTEGRATION_TESTING_CREDS, + this.EMAIL.NOTIFICATIONS, this.EMAIL.PAYROLL, this.EMAIL.QA, this.EMAIL.QA_TRAVIS, diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index e3b6ec77380e..291bab0bff3f 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1224,7 +1224,7 @@ function getOptions( } // Exclude the current user from the personal details list - const optionsToExclude = [{login: currentUserLogin}]; + const optionsToExclude = [{login: currentUserLogin}, {login: CONST.EMAIL.NOTIFICATIONS}]; // If we're including selected options from the search results, we only want to exclude them if the search input is empty // This is because on certain pages, we show the selected options at the top when the search input is empty @@ -1236,6 +1236,7 @@ function getOptions( _.each(excludeLogins, (login) => { optionsToExclude.push({login}); }); + console.log(optionsToExclude); if (includeRecentReports) { for (let i = 0; i < allReportOptions.length; i++) { From 7206bce7f2507d46360bdff31123ffe5a9e327c6 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 15:12:18 +0100 Subject: [PATCH 04/11] exclude from recets --- src/libs/OptionsListUtils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 291bab0bff3f..050118f73b0c 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1247,6 +1247,11 @@ function getOptions( break; } + // Skip notifications@expensify.com + if (reportOption.login === CONST.EMAIL.NOTIFICATIONS) { + continue; + } + const isCurrentUserOwnedPolicyExpenseChatThatCouldShow = reportOption.isPolicyExpenseChat && reportOption.ownerAccountID === currentUserAccountID && includeOwnedWorkspaceChats && !reportOption.isArchivedRoom; From 59f3ebdeb199b21fefe6198af0f1d69e7137a1f7 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Fri, 1 Dec 2023 15:40:33 +0100 Subject: [PATCH 05/11] Refactor WaypointEditor to use new Form provider --- src/pages/iou/WaypointEditor.js | 57 +++++++++++++++++---------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/src/pages/iou/WaypointEditor.js b/src/pages/iou/WaypointEditor.js index 74a3a353ef50..82a0a085579e 100644 --- a/src/pages/iou/WaypointEditor.js +++ b/src/pages/iou/WaypointEditor.js @@ -9,6 +9,8 @@ import AddressSearch from '@components/AddressSearch'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import ConfirmModal from '@components/ConfirmModal'; import Form from '@components/Form'; +import FormProvider from '@components/Form/FormProvider'; +import InputWrapper from '@components/Form/InputWrapper'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import * as Expensicons from '@components/Icon/Expensicons'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -208,7 +210,7 @@ function WaypointEditor({route: {params: {iouType = '', transactionID = '', wayp cancelText={translate('common.cancel')} danger /> -
- - (textInput.current = e)} - hint={!isOffline ? 'distance.errors.selectSuggestedAddress' : ''} - containerStyles={[styles.mt3]} - label={translate('distance.address')} - defaultValue={waypointAddress} - onPress={selectWaypoint} - maxInputLength={CONST.FORM_CHARACTER_LIMIT} - renamedInputKeys={{ - address: `waypoint${waypointIndex}`, - city: null, - country: null, - street: null, - street2: null, - zipCode: null, - lat: null, - lng: null, - state: null, - }} - predefinedPlaces={recentWaypoints} - resultTypes="" - /> - -
+ (textInput.current = e)} + hint={!isOffline ? 'distance.errors.selectSuggestedAddress' : ''} + containerStyles={[styles.mt3]} + label={translate('distance.address')} + defaultValue={waypointAddress} + onPress={selectWaypoint} + maxInputLength={CONST.FORM_CHARACTER_LIMIT} + renamedInputKeys={{ + address: `waypoint${waypointIndex}`, + city: null, + country: null, + street: null, + street2: null, + zipCode: null, + lat: null, + lng: null, + state: null, + }} + predefinedPlaces={recentWaypoints} + resultTypes="" + /> + ); From 34971db8adc3f2ec89a35280d74bd021a1f72a90 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 15:42:29 +0100 Subject: [PATCH 06/11] exclude from LHN --- src/CONST.ts | 1 + src/libs/ReportUtils.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index af254a40b090..d7206b4cb544 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -983,6 +983,7 @@ const CONST = { FIRST_RESPONDER: Number(Config?.EXPENSIFY_ACCOUNT_ID_FIRST_RESPONDER ?? 9375152), HELP: Number(Config?.EXPENSIFY_ACCOUNT_ID_HELP ?? -1), INTEGRATION_TESTING_CREDS: Number(Config?.EXPENSIFY_ACCOUNT_ID_INTEGRATION_TESTING_CREDS ?? -1), + NOTIFICATIONS: Number(Config?.EXPENSIFY_ACCOUNT_ID_NOTIFICATIONS ?? 11665625), PAYROLL: Number(Config?.EXPENSIFY_ACCOUNT_ID_PAYROLL ?? 9679724), QA: Number(Config?.EXPENSIFY_ACCOUNT_ID_QA ?? 3126513), QA_TRAVIS: Number(Config?.EXPENSIFY_ACCOUNT_ID_QA_TRAVIS ?? 8595733), diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f6c3090143f4..ee96a1cfa8a3 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3424,6 +3424,7 @@ function shouldReportBeInOptionList( report?.reportName === undefined || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing report?.isHidden || + report?.participantAccountIDs?.includes(CONST.ACCOUNT_ID.NOTIFICATIONS) || (report?.participantAccountIDs?.length === 0 && !isChatThread(report) && !isPublicRoom(report) && From 202217c75a816f1cae913f1d256ecce8f6b42025 Mon Sep 17 00:00:00 2001 From: Kamil Owczarz Date: Fri, 1 Dec 2023 15:47:52 +0100 Subject: [PATCH 07/11] Fix lint --- src/pages/iou/WaypointEditor.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/iou/WaypointEditor.js b/src/pages/iou/WaypointEditor.js index 82a0a085579e..93c22e28699a 100644 --- a/src/pages/iou/WaypointEditor.js +++ b/src/pages/iou/WaypointEditor.js @@ -2,13 +2,11 @@ import {useNavigation} from '@react-navigation/native'; import lodashGet from 'lodash/get'; import PropTypes from 'prop-types'; import React, {useMemo, useRef, useState} from 'react'; -import {View} from 'react-native'; import {withOnyx} from 'react-native-onyx'; import _ from 'underscore'; import AddressSearch from '@components/AddressSearch'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import ConfirmModal from '@components/ConfirmModal'; -import Form from '@components/Form'; import FormProvider from '@components/Form/FormProvider'; import InputWrapper from '@components/Form/InputWrapper'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; From 17717f5aec04a5557290fdadea98794d2203a339 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:09:10 +0100 Subject: [PATCH 08/11] prevent profile access --- src/pages/home/report/ReportActionItemSingle.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index c50f868cae99..e3e57598e764 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -155,8 +155,10 @@ function ReportActionItemSingle(props) { } }, [isWorkspaceActor, reportID, actorAccountID, props.action.delegateAccountID, iouReportID, displayAllActors]); + console.log(actorAccountID); + console.log(CONST.ACCOUNT_ID.NOTIFICATIONS); const shouldDisableDetailPage = useMemo( - () => !isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID), + () => actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), [props.action, isWorkspaceActor, actorAccountID], ); From 53f10a9f2aa9fa6b4feafd12c5e7c59bac8b1d46 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:09:36 +0100 Subject: [PATCH 09/11] remove debug lines --- src/pages/home/report/ReportActionItemSingle.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index e3e57598e764..129bf3359dc9 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -155,8 +155,6 @@ function ReportActionItemSingle(props) { } }, [isWorkspaceActor, reportID, actorAccountID, props.action.delegateAccountID, iouReportID, displayAllActors]); - console.log(actorAccountID); - console.log(CONST.ACCOUNT_ID.NOTIFICATIONS); const shouldDisableDetailPage = useMemo( () => actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), [props.action, isWorkspaceActor, actorAccountID], From a12d140ccb4b1e25c98f40323cfbb6cb2513a9de Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:51:46 +0100 Subject: [PATCH 10/11] lint --- src/libs/OptionsListUtils.js | 1 - src/libs/ReportUtils.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 050118f73b0c..d5097c46f2cb 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -1236,7 +1236,6 @@ function getOptions( _.each(excludeLogins, (login) => { optionsToExclude.push({login}); }); - console.log(optionsToExclude); if (includeRecentReports) { for (let i = 0; i < allReportOptions.length; i++) { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index ee96a1cfa8a3..42558a97317e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3424,6 +3424,7 @@ function shouldReportBeInOptionList( report?.reportName === undefined || // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing report?.isHidden || + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing report?.participantAccountIDs?.includes(CONST.ACCOUNT_ID.NOTIFICATIONS) || (report?.participantAccountIDs?.length === 0 && !isChatThread(report) && From 9379c26d767f6e6cbd189dd66be22f110c135ac4 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 1 Dec 2023 16:52:11 +0100 Subject: [PATCH 11/11] prettier --- src/pages/home/report/ReportActionItemSingle.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItemSingle.js b/src/pages/home/report/ReportActionItemSingle.js index 129bf3359dc9..39bce4bf067a 100644 --- a/src/pages/home/report/ReportActionItemSingle.js +++ b/src/pages/home/report/ReportActionItemSingle.js @@ -156,7 +156,9 @@ function ReportActionItemSingle(props) { }, [isWorkspaceActor, reportID, actorAccountID, props.action.delegateAccountID, iouReportID, displayAllActors]); const shouldDisableDetailPage = useMemo( - () => actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), + () => + actorAccountID === CONST.ACCOUNT_ID.NOTIFICATIONS || + (!isWorkspaceActor && ReportUtils.isOptimisticPersonalDetail(props.action.delegateAccountID ? props.action.delegateAccountID : actorAccountID)), [props.action, isWorkspaceActor, actorAccountID], );