Skip to content

Commit

Permalink
fix: ReportScreen null values
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Jun 5, 2024
1 parent 38bf703 commit f13c27e
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 46 deletions.
2 changes: 1 addition & 1 deletion src/components/HeaderWithBackButton/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ type HeaderWithBackButtonProps = Partial<ChildrenProps> & {
report?: OnyxEntry<Report>;

/** The report's policy, if we're showing the details for a report and need info about it for AvatarWithDisplay */
policy?: OnyxEntry<Policy>;
policy?: OnyxEntry<Policy> | null;

/** Single execution function to prevent concurrent navigation actions */
singleExecution?: <T extends unknown[]>(action: Action<T>) => Action<T>;
Expand Down
2 changes: 1 addition & 1 deletion src/components/MoneyReportHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type MoneyReportHeaderProps = {
report: OnyxTypes.Report;

/** The policy tied to the expense report */
policy: OnyxEntry<OnyxTypes.Policy>;
policy: OnyxEntry<OnyxTypes.Policy> | null;

/** Array of report actions for the report */
reportActions: OnyxTypes.ReportAction[];
Expand Down
4 changes: 2 additions & 2 deletions src/components/MoneyRequestHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ type MoneyRequestHeaderProps = {
report: Report;

/** The policy which the report is tied to */
policy: OnyxEntry<Policy>;
policy: OnyxEntry<Policy> | null;

/** The report action the transaction is tied to from the parent report */
parentReportAction: OnyxEntry<ReportAction>;
parentReportAction: OnyxEntry<ReportAction> | null;

/** Whether we should display the header as in narrow layout */
shouldUseNarrowLayout?: boolean;
Expand Down
10 changes: 5 additions & 5 deletions src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {SelectorType} from '@components/SelectionScreen';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type {Policy, PolicyCategories, PolicyEmployeeList, PolicyTagList, PolicyTags, TaxRate} from '@src/types/onyx';
import type {OnyxInputOrEntry, Policy, PolicyCategories, PolicyEmployeeList, PolicyTagList, PolicyTags, TaxRate} from '@src/types/onyx';
import type {PolicyFeatureName, Rate, Tenant} from '@src/types/onyx/Policy';
import type PolicyEmployee from '@src/types/onyx/PolicyEmployee';
import type {EmptyObject} from '@src/types/utils/EmptyObject';
Expand Down Expand Up @@ -142,7 +142,7 @@ function isExpensifyTeam(email: string | undefined): boolean {
/**
* Checks if the current user is an admin of the policy.
*/
const isPolicyAdmin = (policy: OnyxEntry<Policy> | EmptyObject, currentUserLogin?: string): boolean =>
const isPolicyAdmin = (policy: OnyxInputOrEntry<Policy> | EmptyObject, currentUserLogin?: string): boolean =>

Check failure on line 145 in src/libs/PolicyUtils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'any' overrides all other types in this union type
(policy?.role ?? (currentUserLogin && policy?.employeeList?.[currentUserLogin]?.role)) === CONST.POLICY.ROLE.ADMIN;

/**
Expand All @@ -155,7 +155,7 @@ const isPolicyEmployee = (policyID: string, policies: OnyxCollection<Policy>): b
/**
* Checks if the current user is an owner (creator) of the policy.
*/
const isPolicyOwner = (policy: OnyxEntry<Policy> | EmptyObject, currentUserAccountID: number): boolean => policy?.ownerAccountID === currentUserAccountID;
const isPolicyOwner = (policy: OnyxInputOrEntry<Policy> | EmptyObject, currentUserAccountID: number): boolean => policy?.ownerAccountID === currentUserAccountID;

Check failure on line 158 in src/libs/PolicyUtils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'any' overrides all other types in this union type

/**
* Create an object mapping member emails to their accountIDs. Filter for members without errors if includeMemberWithErrors is false, and get the login email from the personalDetail object using the accountID.
Expand Down Expand Up @@ -297,14 +297,14 @@ function isTaxTrackingEnabled(isPolicyExpenseChat: boolean, policy: OnyxEntry<Po
* Checks if policy's scheduled submit / auto reporting frequency is "instant".
* Note: Free policies have "instant" submit always enabled.
*/
function isInstantSubmitEnabled(policy: OnyxEntry<Policy> | EmptyObject): boolean {
function isInstantSubmitEnabled(policy: OnyxInputOrEntry<Policy> | EmptyObject): boolean {

Check failure on line 300 in src/libs/PolicyUtils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'any' overrides all other types in this union type
return policy?.type === CONST.POLICY.TYPE.FREE || (policy?.autoReporting === true && policy?.autoReportingFrequency === CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT);
}

/**
* Checks if policy's approval mode is "optional", a.k.a. "Submit & Close"
*/
function isSubmitAndClose(policy: OnyxEntry<Policy> | EmptyObject): boolean {
function isSubmitAndClose(policy: OnyxInputOrEntry<Policy> | EmptyObject): boolean {

Check failure on line 307 in src/libs/PolicyUtils.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

'any' overrides all other types in this union type
return policy?.approvalMode === CONST.POLICY.APPROVAL_MODE.OPTIONAL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function isSentMoneyReportAction(reportAction: OnyxEntry<ReportAction | Optimist
* Returns whether the thread is a transaction thread, which is any thread with IOU parent
* report action from requesting money (type - create) or from sending money (type - pay with IOUDetails field)
*/
function isTransactionThread(parentReportAction: OnyxEntry<ReportAction> | EmptyObject): boolean {
function isTransactionThread(parentReportAction: OnyxInputOrEntry<ReportAction> | EmptyObject): boolean {
return (
parentReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU &&
(parentReportAction.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.CREATE ||
Expand Down
40 changes: 20 additions & 20 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ function getPolicy(policyID: string | undefined): Policy | EmptyObject {
* Get the policy type from a given report
* @param policies must have Onyxkey prefix (i.e 'policy_') for keys
*/
function getPolicyType(report: OnyxEntry<Report>, policies: OnyxCollection<Policy>): string {
function getPolicyType(report: OnyxInputOrEntry<Report>, policies: OnyxCollection<Policy>): string {
return policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]?.type ?? '';
}

Expand Down Expand Up @@ -711,7 +711,7 @@ function isChatReport(report: OnyxEntry<Report> | EmptyObject): boolean {
return report?.type === CONST.REPORT.TYPE.CHAT;
}

function isInvoiceReport(report: OnyxEntry<Report> | EmptyObject): boolean {
function isInvoiceReport(report: OnyxInputOrEntry<Report> | EmptyObject): boolean {
return report?.type === CONST.REPORT.TYPE.INVOICE;
}

Expand All @@ -725,7 +725,7 @@ function isExpenseReport(report: OnyxInputOrEntry<Report> | EmptyObject): boolea
/**
* Checks if a report is an IOU report using report or reportID
*/
function isIOUReport(reportOrID: OnyxEntry<Report> | string | EmptyObject): boolean {
function isIOUReport(reportOrID: OnyxInputOrEntry<Report> | string | EmptyObject): boolean {
const report = typeof reportOrID === 'string' ? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportOrID}`] ?? null : reportOrID;
return report?.type === CONST.REPORT.TYPE.IOU;
}
Expand All @@ -739,7 +739,7 @@ function isIOUReportUsingReport(report: OnyxEntry<Report> | EmptyObject): report
/**
* Checks if a report is a task report.
*/
function isTaskReport(report: OnyxEntry<Report>): boolean {
function isTaskReport(report: OnyxInputOrEntry<Report>): boolean {
return report?.type === CONST.REPORT.TYPE.TASK;
}

Expand All @@ -750,7 +750,7 @@ function isTaskReport(report: OnyxEntry<Report>): boolean {
* There's another situation where you don't have access to the parentReportAction (because it was created in a chat you don't have access to)
* In this case, we have added the key to the report itself
*/
function isCanceledTaskReport(report: OnyxEntry<Report> | EmptyObject = {}, parentReportAction: OnyxEntry<ReportAction> | EmptyObject = {}): boolean {
function isCanceledTaskReport(report: OnyxInputOrEntry<Report> | EmptyObject = {}, parentReportAction: OnyxInputOrEntry<ReportAction> | EmptyObject = {}): boolean {
if (!isEmptyObject(parentReportAction) && (parentReportAction?.message?.[0]?.isDeletedParentAction ?? false)) {
return true;
}
Expand All @@ -767,7 +767,7 @@ function isCanceledTaskReport(report: OnyxEntry<Report> | EmptyObject = {}, pare
*
* @param parentReportAction - The parent report action of the report (Used to check if the task has been canceled)
*/
function isOpenTaskReport(report: OnyxEntry<Report>, parentReportAction: OnyxEntry<ReportAction> | EmptyObject = {}): boolean {
function isOpenTaskReport(report: OnyxInputOrEntry<Report>, parentReportAction: OnyxInputOrEntry<ReportAction> | EmptyObject = {}): boolean {
return (
isTaskReport(report) && !isCanceledTaskReport(report, parentReportAction) && report?.stateNum === CONST.REPORT.STATE_NUM.OPEN && report?.statusNum === CONST.REPORT.STATUS_NUM.OPEN
);
Expand All @@ -790,15 +790,15 @@ function isReportManager(report: OnyxEntry<Report>): boolean {
/**
* Checks if the supplied report has been approved
*/
function isReportApproved(reportOrID: OnyxEntry<Report> | string | EmptyObject): boolean {
function isReportApproved(reportOrID: OnyxInputOrEntry<Report> | string | EmptyObject): boolean {
const report = typeof reportOrID === 'string' ? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportOrID}`] ?? null : reportOrID;
return report?.stateNum === CONST.REPORT.STATE_NUM.APPROVED && report?.statusNum === CONST.REPORT.STATUS_NUM.APPROVED;
}

/**
* Checks if the supplied report is an expense report in Open state and status.
*/
function isOpenExpenseReport(report: OnyxEntry<Report> | EmptyObject): boolean {
function isOpenExpenseReport(report: OnyxInputOrEntry<Report> | EmptyObject): boolean {
return isExpenseReport(report) && report?.stateNum === CONST.REPORT.STATE_NUM.OPEN && report?.statusNum === CONST.REPORT.STATUS_NUM.OPEN;
}

Expand Down Expand Up @@ -898,7 +898,7 @@ function isUserCreatedPolicyRoom(report: OnyxEntry<Report>): boolean {
/**
* Whether the provided report is a Policy Expense chat.
*/
function isPolicyExpenseChat(report: OnyxEntry<Report> | Participant | EmptyObject): boolean {
function isPolicyExpenseChat(report: OnyxInputOrEntry<Report> | Participant | EmptyObject): boolean {
return getChatType(report) === CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT || (report?.isPolicyExpenseChat ?? false);
}

Expand Down Expand Up @@ -938,7 +938,7 @@ function isGroupPolicy(policyType: string): boolean {
/**
* Whether the provided report belongs to a Free, Collect or Control policy
*/
function isReportInGroupPolicy(report: OnyxEntry<Report>, policy?: OnyxEntry<Policy>): boolean {
function isReportInGroupPolicy(report: OnyxInputOrEntry<Report>, policy?: OnyxInputOrEntry<Policy>): boolean {
const policyType = policy?.type ?? getPolicyType(report, allPolicies);
return isGroupPolicy(policyType);
}
Expand Down Expand Up @@ -1244,7 +1244,7 @@ function isClosedExpenseReportWithNoExpenses(report: OnyxEntry<Report>): boolean
/**
* Whether the provided report is an archived room
*/
function isArchivedRoom(report: OnyxEntry<Report> | EmptyObject, reportNameValuePairs?: OnyxEntry<ReportNameValuePairs> | EmptyObject): boolean {
function isArchivedRoom(report: OnyxInputOrEntry<Report> | EmptyObject, reportNameValuePairs?: OnyxInputOrEntry<ReportNameValuePairs> | EmptyObject): boolean {
if (reportNameValuePairs) {
return reportNameValuePairs.isArchived;
}
Expand Down Expand Up @@ -1422,7 +1422,7 @@ function isMoneyRequest(reportOrID: OnyxEntry<Report> | string): boolean {
/**
* Checks if a report is an IOU or expense report.
*/
function isMoneyRequestReport(reportOrID: OnyxEntry<Report> | EmptyObject | string): boolean {
function isMoneyRequestReport(reportOrID: OnyxInputOrEntry<Report> | EmptyObject | string): boolean {
const report = typeof reportOrID === 'object' ? reportOrID : allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportOrID}`] ?? undefined;
return isIOUReport(report) || isExpenseReport(report);
}
Expand Down Expand Up @@ -2347,7 +2347,7 @@ function hasNonReimbursableTransactions(iouReportID: string | undefined): boolea
return transactions.filter((transaction) => transaction.reimbursable === false).length > 0;
}

function getMoneyRequestSpendBreakdown(report: OnyxEntry<Report>, allReportsDict?: OnyxCollection<Report>): SpendBreakdown {
function getMoneyRequestSpendBreakdown(report: OnyxInputOrEntry<Report>, allReportsDict?: OnyxCollection<Report>): SpendBreakdown {
const allAvailableReports = allReportsDict ?? allReports;
let moneyRequestReport;
if (isMoneyRequestReport(report) || isInvoiceReport(report)) {
Expand Down Expand Up @@ -2728,7 +2728,7 @@ function canEditFieldOfMoneyRequest(reportAction: OnyxEntry<ReportAction>, field
* - It's an expense where conditions for editability are defined in canEditMoneyRequest method
* - It's not pending deletion
*/
function canEditReportAction(reportAction: OnyxEntry<ReportAction>): boolean {
function canEditReportAction(reportAction: OnyxInputOrEntry<ReportAction>): boolean {
const isCommentOrIOU = reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU;

return Boolean(
Expand Down Expand Up @@ -6390,7 +6390,7 @@ function shouldDisplayThreadReplies(reportAction: OnyxEntry<ReportAction>, repor
/**
* Check if money report has any transactions updated optimistically
*/
function hasUpdatedTotal(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
function hasUpdatedTotal(report: OnyxInputOrEntry<Report>, policy: OnyxInputOrEntry<Policy>): boolean {
if (!report) {
return true;
}
Expand All @@ -6406,7 +6406,7 @@ function hasUpdatedTotal(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>):
/**
* Return held and full amount formatted with used currency
*/
function getNonHeldAndFullAmount(iouReport: OnyxEntry<Report>, policy: OnyxEntry<Policy>): string[] {
function getNonHeldAndFullAmount(iouReport: OnyxInputOrEntry<Report>, policy: OnyxInputOrEntry<Policy>): string[] {
const transactions = TransactionUtils.getAllReportTransactions(iouReport?.reportID ?? '');
const hasPendingTransaction = transactions.some((transaction) => !!transaction.pendingAction);

Expand Down Expand Up @@ -6560,7 +6560,7 @@ function getOptimisticDataForParentReportAction(reportID: string, lastVisibleAct
});
}

function canBeAutoReimbursed(report: OnyxEntry<Report>, policy: OnyxEntry<Policy> | EmptyObject): boolean {
function canBeAutoReimbursed(report: OnyxInputOrEntry<Report>, policy: OnyxInputOrEntry<Policy> | EmptyObject): boolean {
if (isEmptyObject(policy)) {
return false;
}
Expand All @@ -6577,7 +6577,7 @@ function canBeAutoReimbursed(report: OnyxEntry<Report>, policy: OnyxEntry<Policy
}

/** Check if the current user is an owner of the report */
function isReportOwner(report: OnyxEntry<Report>): boolean {
function isReportOwner(report: OnyxInputOrEntry<Report>): boolean {
return report?.ownerAccountID === currentUserPersonalDetails?.accountID;
}

Expand Down Expand Up @@ -6647,14 +6647,14 @@ function hasActionsWithErrors(reportID: string): boolean {
return Object.values(reportActions).some((action) => !isEmptyObject(action.errors));
}

function isNonAdminOrOwnerOfPolicyExpenseChat(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
function isNonAdminOrOwnerOfPolicyExpenseChat(report: OnyxInputOrEntry<Report>, policy: OnyxInputOrEntry<Policy>): boolean {
return isPolicyExpenseChat(report) && !(PolicyUtils.isPolicyAdmin(policy) || PolicyUtils.isPolicyOwner(policy, currentUserAccountID ?? -1) || isReportOwner(report));
}

/**
* Whether the user can join a report
*/
function canJoinChat(report: OnyxEntry<Report>, parentReportAction: OnyxEntry<ReportAction>, policy: OnyxEntry<Policy>): boolean {
function canJoinChat(report: OnyxInputOrEntry<Report>, parentReportAction: OnyxInputOrEntry<ReportAction>, policy: OnyxInputOrEntry<Policy>): boolean {
// We disabled thread functions for whisper action
// So we should not show join option for existing thread on whisper message that has already been left, or manually leave it
if (ReportActionsUtils.isWhisperAction(parentReportAction)) {
Expand Down
14 changes: 11 additions & 3 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {format} from 'date-fns';
import fastMerge from 'expensify-common/lib/fastMerge';
import Str from 'expensify-common/lib/str';
import type {OnyxCollection, OnyxCollectionInput, OnyxEntry, OnyxInputValue, OnyxUpdate} from 'react-native-onyx';
import type {OnyxCollection, OnyxEntry, OnyxInputValue, OnyxUpdate} from 'react-native-onyx';
import Onyx from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import ReceiptGeneric from '@assets/images/receipt-generic.png';
Expand Down Expand Up @@ -6044,7 +6044,11 @@ function sendMoneyWithWallet(report: OnyxEntry<OnyxTypes.Report>, amount: number
Report.notifyNewAction(params.chatReportID, managerID);
}

function canApproveIOU(iouReport: OnyxEntry<OnyxTypes.Report> | EmptyObject, chatReport: OnyxEntry<OnyxTypes.Report> | EmptyObject, policy: OnyxEntry<OnyxTypes.Policy> | EmptyObject) {
function canApproveIOU(
iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | EmptyObject,
chatReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | EmptyObject,
policy: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Policy> | EmptyObject,
) {
if (isEmptyObject(chatReport)) {
return false;
}
Expand All @@ -6071,7 +6075,11 @@ function canApproveIOU(iouReport: OnyxEntry<OnyxTypes.Report> | EmptyObject, cha
return isCurrentUserManager && !isOpenExpenseReport && !isApproved && !iouSettled && !isArchivedReport;
}

function canIOUBePaid(iouReport: OnyxEntry<OnyxTypes.Report> | EmptyObject, chatReport: OnyxEntry<OnyxTypes.Report> | EmptyObject, policy: OnyxEntry<OnyxTypes.Policy> | EmptyObject) {
function canIOUBePaid(
iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | EmptyObject,
chatReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | EmptyObject,
policy: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Policy> | EmptyObject,
) {
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(chatReport);
const isChatReportArchived = ReportUtils.isArchivedRoom(chatReport);
const iouSettled = ReportUtils.isSettled(iouReport?.reportID);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/HeaderView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type HeaderViewProps = HeaderViewOnyxProps & {
report: OnyxTypes.Report;

/** The report action the transaction is tied to from the parent report */
parentReportAction: OnyxEntry<OnyxTypes.ReportAction>;
parentReportAction: OnyxEntry<OnyxTypes.ReportAction> | null;

/** The reportID of the current report */
reportID: string;
Expand Down
10 changes: 5 additions & 5 deletions src/pages/home/ReportScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ function isEmpty(report: OnyxTypes.Report): boolean {
return !Object.values(report).some((value) => value !== undefined && value !== '');
}

function getParentReportAction(parentReportActions: OnyxEntry<OnyxTypes.ReportActions>, parentReportActionID: string | undefined): OnyxEntry<OnyxTypes.ReportAction> {
function getParentReportAction(parentReportActions: OnyxEntry<OnyxTypes.ReportActions>, parentReportActionID: string | undefined): OnyxEntry<OnyxTypes.ReportAction> | null {
if (!parentReportActions || !parentReportActionID) {
return;
return null;
}
return parentReportActions[parentReportActionID ?? '0'];
}
Expand Down Expand Up @@ -290,15 +290,15 @@ function ReportScreen({
const hasHelpfulErrors = Object.keys(report?.errorFields ?? {}).some((key) => key !== 'notFound');
const shouldHideReport = !hasHelpfulErrors && !ReportUtils.canAccessReport(report, policies, betas);

const lastReportAction: OnyxEntry<OnyxTypes.ReportAction> = useMemo(
const lastReportAction: OnyxEntry<OnyxTypes.ReportAction> | null = useMemo(
() =>
reportActions.length
? [...reportActions, parentReportAction].find((action) => ReportUtils.canEditReportAction(action) && !ReportActionsUtils.isMoneyRequestAction(action))
: undefined,
: null,
[reportActions, parentReportAction],
);
const isSingleTransactionView = ReportUtils.isMoneyRequest(report) || ReportUtils.isTrackExpenseReport(report);
const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`];
const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`] ?? null;
const isTopMostReportId = currentReportID === reportIDFromRoute;
const didSubscribeToReportLeavingEvents = useRef(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ type ComposerWithSuggestionsProps = ComposerWithSuggestionsOnyxProps &
isEmptyChat?: boolean;

/** The last report action */
lastReportAction?: OnyxEntry<OnyxTypes.ReportAction>;
lastReportAction?: OnyxEntry<OnyxTypes.ReportAction> | null;

/** Whether to include chronos */
includeChronos?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ type ReportActionItemProps = {
reportActions: OnyxTypes.ReportAction[];

/** Report action belonging to the report's parent */
parentReportAction: OnyxEntry<OnyxTypes.ReportAction>;
parentReportAction: OnyxEntry<OnyxTypes.ReportAction> | null;

/** The transaction thread report's parentReportAction */
/** It's used by withOnyx HOC */
Expand Down
Loading

0 comments on commit f13c27e

Please sign in to comment.