Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix invoice category #49142

Merged
merged 14 commits into from
Sep 25, 2024
1 change: 1 addition & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ type OptionData = {
tabIndex?: 0 | -1;
isConciergeChat?: boolean;
isBold?: boolean;
isSender?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property is not used, let's remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove this property, we get a type error 'isSender' does not exist on type 'OptionData | Participant'. Property 'isSender' does not exist on type 'OptionData'.

Copy link
Contributor

@rayane-djouah rayane-djouah Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nodebrute Let's update the condition to:

const senderPolicyParticipant = participants?.find((participant) => !!participant && 'isSender' in participant && participant.isSender);

and remove isSender property from OptionData type.

} & Report;

type OnyxDataTaskAssigneeChat = {
Expand Down
6 changes: 5 additions & 1 deletion src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,11 @@ function IOURequestStepConfirmation({
if (policyExpenseChat?.policyID && policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
openDraftWorkspaceRequest(policyExpenseChat.policyID);
}
}, [isOffline, participants, transaction?.billable, policy, transactionID]);
const senderPolicyParticipant = participants?.find((participant) => participant.isSender);
if (senderPolicyParticipant?.policyID && policy?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
openDraftWorkspaceRequest(senderPolicyParticipant.policyID);
}
}, [isOffline, participants, policy?.pendingAction]);

const defaultBillable = !!policy?.defaultBillable;
useEffect(() => {
Expand Down
Loading