Skip to content

Commit

Permalink
Merge pull request #10369 from Expensify/Rory-RemoveUnusedFunctions
Browse files Browse the repository at this point in the history
[No QA] Remove unused functions from src/libs/actions/ReportActions
  • Loading branch information
jasperhuangg authored Aug 15, 2022
2 parents c2e99f2 + 983b37c commit 2fafbf2
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/libs/actions/ReportActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,6 @@ Onyx.connect({
},
});

/**
* WARNING: Do not use this method to access the maxSequenceNumber for a report. This ONLY returns the maxSequenceNumber
* for reportActions that are stored in Onyx under a reportActions_* key.
*
* @param {Number} reportID
* @param {Boolean} shouldWarn
* @returns {Number}
*/
function dangerouslyGetReportActionsMaxSequenceNumber(reportID, shouldWarn = true) {
if (shouldWarn) {
console.error('WARNING: dangerouslyGetReportActionsMaxSequenceNumber is unreliable as it ONLY references '
+ 'reportActions in storage. It should not be used to access the maxSequenceNumber for a report. Use '
+ 'reportMaxSequenceNumbers[reportID] instead.');
}

return reportActionsMaxSequenceNumbers[reportID];
}

/**
* Compares the maximum sequenceNumber that we know about with the most recent report action we have saved.
* If we have no report actions at all for the report we will assume that it is missing actions.
*
* @param {Number} reportID
* @param {Number} maxKnownSequenceNumber
* @returns {Boolean}
*/
function isReportMissingActions(reportID, maxKnownSequenceNumber) {
return _.isUndefined(reportActionsMaxSequenceNumbers[reportID])
|| reportActionsMaxSequenceNumbers[reportID] < maxKnownSequenceNumber;
}

/**
* Get the count of deleted messages after a sequence number of a report
* @param {Number|String} reportID
Expand Down Expand Up @@ -141,8 +110,6 @@ function deleteClientAction(reportID, clientID) {
}

export {
isReportMissingActions,
dangerouslyGetReportActionsMaxSequenceNumber,
getDeletedCommentsCount,
getLastVisibleMessageText,
isFromCurrentUser,
Expand Down

0 comments on commit 2fafbf2

Please sign in to comment.