Skip to content

Commit

Permalink
Merge pull request #27740 from dukenv0307/fix/27159
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrous authored Sep 22, 2023
2 parents fa6a767 + 6a8b7d8 commit 30e494b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,7 @@ function editMoneyRequest(transactionID, transactionThreadReportID, transactionC
}

// STEP 4: Compose the optimistic data
const currentTime = DateUtils.getDBTime();
const optimisticData = [
{
onyxMethod: Onyx.METHOD.MERGE,
Expand All @@ -1171,6 +1172,14 @@ function editMoneyRequest(transactionID, transactionThreadReportID, transactionC
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.chatReportID}`,
value: updatedChatReport,
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`,
value: {
lastReadTime: currentTime,
lastVisibleActionCreated: currentTime,
},
},
];

const successData = [
Expand Down Expand Up @@ -1227,6 +1236,14 @@ function editMoneyRequest(transactionID, transactionThreadReportID, transactionC
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.chatReportID}`,
value: chatReport,
},
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`,
value: {
lastReadTime: transactionThread.lastReadTime,
lastVisibleActionCreated: transactionThread.lastVisibleActionCreated,
},
},
];

// STEP 6: Call the API endpoint
Expand Down

0 comments on commit 30e494b

Please sign in to comment.