Skip to content

Commit

Permalink
Fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gedu committed Sep 27, 2024
1 parent 2792cfe commit 703957d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/libs/Network/SequentialQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,14 @@ function isPaused(): boolean {
NetworkStore.onReconnection(flush);

function push(newRequest: OnyxRequest) {
// If a request is already being processed, ignore it when looking for potentially conflicting requests
const requests = PersistedRequests.getAll();

const {checkAndFixConflictingRequest} = newRequest;

if (checkAndFixConflictingRequest) {
const requests = PersistedRequests.getAll();
const {conflictAction} = checkAndFixConflictingRequest(requests);
Log.info(`[SequentialQueue] Conflict action for command ${newRequest.command} - ${conflictAction.type}:`);

// No need to serialize it.
// don't try to serialize a function.
// eslint-disable-next-line no-param-reassign
delete newRequest.checkAndFixConflictingRequest;

Expand Down
8 changes: 4 additions & 4 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function isActionOfType<T extends ReportActionName[]>(
function getOriginalMessage<T extends ReportActionName>(reportAction: OnyxInputOrEntry<ReportAction<T>>): OriginalMessage<T> | undefined {
if (!Array.isArray(reportAction?.message)) {
// eslint-disable-next-line deprecation/deprecation
return reportAction?.message ?? reportAction.originalMessage;
return reportAction?.message ?? reportAction?.originalMessage;
}
// eslint-disable-next-line deprecation/deprecation
return reportAction.originalMessage;
Expand Down Expand Up @@ -697,7 +697,7 @@ function isResolvedActionTrackExpense(reportAction: OnyxEntry<ReportAction>): bo
* Checks if a reportAction is fit for display as report last action, meaning that
* it satisfies shouldReportActionBeVisible, it's not whisper action and not deleted.
*/
function shouldReportActionBeVisibleAsLastAction(reportAction: OnyxInputOrEntry<ReportAction>, key: string | number): boolean {
function shouldReportActionBeVisibleAsLastAction(reportAction: OnyxInputOrEntry<ReportAction>): boolean {
if (!reportAction) {
return false;
}
Expand All @@ -709,7 +709,7 @@ function shouldReportActionBeVisibleAsLastAction(reportAction: OnyxInputOrEntry<
// If a whisper action is the REPORT_PREVIEW action, we are displaying it.
// If the action's message text is empty and it is not a deleted parent with visible child actions, hide it. Else, consider the action to be displayable.
return (
shouldReportActionBeVisible(reportAction, key) &&
shouldReportActionBeVisible(reportAction, reportAction.reportActionID) &&
!(isWhisperAction(reportAction) && !isReportPreviewAction(reportAction) && !isMoneyRequestAction(reportAction)) &&
!(isDeletedAction(reportAction) && !isDeletedParentAction(reportAction)) &&
!isResolvedActionTrackExpense(reportAction)
Expand Down Expand Up @@ -823,7 +823,7 @@ function getSortedReportActionsForDisplay(reportActions: OnyxEntry<ReportActions
filteredReportActions = Object.values(reportActions).filter(Boolean);
} else {
filteredReportActions = Object.entries(reportActions)
.filter(([, reportAction]) => shouldReportActionBeVisible(reportAction))
.filter(([key, reportAction]) => shouldReportActionBeVisible(reportAction, key))
.map(([, reportAction]) => reportAction);
}

Expand Down

0 comments on commit 703957d

Please sign in to comment.