Skip to content

Commit

Permalink
fix unread marker of modified messsage
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Sep 19, 2023
1 parent 3bffd67 commit 6a8b7d8
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 @@ -1087,6 +1087,7 @@ function editMoneyRequest(transactionID, transactionThreadReportID, transactionC
}

// STEP 4: Compose the optimistic data
const currentTime = DateUtils.getDBTime();
const optimisticData = [
{
onyxMethod: Onyx.METHOD.MERGE,
Expand All @@ -1110,6 +1111,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 @@ -1163,6 +1172,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 6a8b7d8

Please sign in to comment.