Skip to content

Commit

Permalink
Merge pull request #42197 from bernhardoj/fix/41575-send-invoice-rese…
Browse files Browse the repository at this point in the history
…t-workspace-switcher

Fix workspace switcher is reset to "Expensify" when sending invoice on the same WS
  • Loading branch information
puneetlath authored May 27, 2024
2 parents 67b8b38 + 246541c commit 2a12294
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ type TrackExpenseInformation = {
type SendInvoiceInformation = {
senderWorkspaceID: string;
receiver: Partial<OnyxTypes.PersonalDetails>;
invoiceRoomReportID: string;
invoiceRoom: OnyxTypes.Report;
createdChatReportActionID: string;
invoiceReportID: string;
reportPreviewReportActionID: string;
Expand Down Expand Up @@ -1758,7 +1758,7 @@ function getSendInvoiceInformation(
return {
senderWorkspaceID,
receiver,
invoiceRoomReportID: chatReport.reportID,
invoiceRoom: chatReport,
createdChatReportActionID: optimisticCreatedActionForChat.reportActionID,
invoiceReportID: optimisticInvoiceReport.reportID,
reportPreviewReportActionID: reportPreviewAction.reportActionID,
Expand Down Expand Up @@ -3442,7 +3442,7 @@ function sendInvoice(
policyTagList?: OnyxEntry<OnyxTypes.PolicyTagList>,
policyCategories?: OnyxEntry<OnyxTypes.PolicyCategories>,
) {
const {senderWorkspaceID, receiver, invoiceRoomReportID, createdChatReportActionID, invoiceReportID, reportPreviewReportActionID, transactionID, transactionThreadReportID, onyxData} =
const {senderWorkspaceID, receiver, invoiceRoom, createdChatReportActionID, invoiceReportID, reportPreviewReportActionID, transactionID, transactionThreadReportID, onyxData} =
getSendInvoiceInformation(transaction, currentUserAccountID, invoiceChatReport, receiptFile, policy, policyTagList, policyCategories);

let parameters: SendInvoiceParams = {
Expand All @@ -3454,7 +3454,7 @@ function sendInvoice(
merchant: transaction?.merchant ?? '',
category: transaction?.category,
date: transaction?.created ?? '',
invoiceRoomReportID,
invoiceRoomReportID: invoiceRoom.reportID,
createdChatReportActionID,
invoiceReportID,
reportPreviewReportActionID,
Expand All @@ -3476,8 +3476,8 @@ function sendInvoice(

API.write(WRITE_COMMANDS.SEND_INVOICE, parameters, onyxData);

Navigation.dismissModal(invoiceRoomReportID);
Report.notifyNewAction(invoiceRoomReportID, receiver.accountID);
Navigation.dismissModalWithReport(invoiceRoom);
Report.notifyNewAction(invoiceRoom.reportID, receiver.accountID);
}

/**
Expand Down

0 comments on commit 2a12294

Please sign in to comment.