Skip to content

Commit

Permalink
fix: ReportActionCompose
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Jun 5, 2024
1 parent f13c27e commit a93bafd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6704,7 +6704,7 @@ function canLeaveChat(report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boo
return (isChatThread(report) && !!report?.notificationPreference?.length) || isUserCreatedPolicyRoom(report) || isNonAdminOrOwnerOfPolicyExpenseChat(report, policy);
}

function getReportActionActorAccountID(reportAction: OnyxEntry<ReportAction>, iouReport: OnyxEntry<Report> | undefined): number | undefined {
function getReportActionActorAccountID(reportAction: OnyxInputOrEntry<ReportAction>, iouReport: OnyxInputOrEntry<Report> | undefined): number | undefined {
switch (reportAction?.actionName) {
case CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW:
return iouReport ? iouReport.managerID : reportAction?.actorAccountID;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ type ReportActionItemOnyxProps = {
transaction: OnyxEntry<OnyxTypes.Transaction>;

/** The transaction (linked with the report action) route error */
linkedTransactionRouteError: OnyxEntry<Errors>;
linkedTransactionRouteError: NonNullable<OnyxEntry<Errors>> | null;
};

type ReportActionItemProps = {
Expand Down Expand Up @@ -1069,7 +1069,7 @@ export default withOnyx<ReportActionItemProps, ReportActionItemOnyxProps>({
},
linkedTransactionRouteError: {
key: ({action}) => `${ONYXKEYS.COLLECTION.TRANSACTION}${(action as OnyxTypes.OriginalMessageIOU)?.originalMessage?.IOUTransactionID ?? 0}`,
selector: (transaction: OnyxEntry<OnyxTypes.Transaction>) => transaction?.errorFields?.route ?? undefined,
selector: (transaction: OnyxEntry<OnyxTypes.Transaction>) => transaction?.errorFields?.route ?? null,
},
modal: {
key: ONYXKEYS.MODAL,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemSingle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import ReportActionItemFragment from './ReportActionItemFragment';

type ReportActionItemSingleProps = Partial<ChildrenProps> & {
/** All the data of the action */
action: OnyxEntry<ReportAction>;
action: OnyxEntry<ReportAction> | null;

/** Styles for the outermost View */
wrapperStyle?: StyleProp<ViewStyle>;
Expand Down

0 comments on commit a93bafd

Please sign in to comment.