Skip to content

Commit ffaa8be

Browse files
committed
Using pending fields live data
Signed-off-by: Tsaqif <tsaiinkwa@yahoo.com>
1 parent 158ffb3 commit ffaa8be

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

src/components/Search/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ function Search({
425425
return [filteredData1, filteredData1.length, allLength];
426426
}, [
427427
searchKey,
428-
isFocused,
429428
exportReportActions,
430429
validGroupBy,
431430
isDataLoaded,

src/libs/ReportUtils.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import type {ReportTransactionsAndViolations} from '@src/types/onyx/DerivedValue
6464
import type {Attendee, Participant} from '@src/types/onyx/IOU';
6565
import type {OriginalMessageExportedToIntegration} from '@src/types/onyx/OldDotAction';
6666
import type Onboarding from '@src/types/onyx/Onboarding';
67-
import type {ErrorFields, Errors, Icon, PendingAction, PendingFields} from '@src/types/onyx/OnyxCommon';
67+
import type {ErrorFields, Errors, Icon, PendingAction} from '@src/types/onyx/OnyxCommon';
6868
import type {
6969
OriginalMessageChangeLog,
7070
OriginalMessageChangePolicy,
@@ -6213,14 +6213,6 @@ function getPendingChatMembers(accountIDs: number[], previousPendingChatMembers:
62136213
return [...previousPendingChatMembers, ...pendingChatMembers];
62146214
}
62156215

6216-
/**
6217-
* Get pendingFields of a report
6218-
*/
6219-
function getReportPendingFields(reportID: string): PendingFields<string> | undefined {
6220-
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
6221-
return report?.pendingFields;
6222-
}
6223-
62246216
/**
62256217
* Gets the parent navigation subtitle for the report
62266218
*/
@@ -13103,7 +13095,6 @@ export {
1310313095
getParticipantsList,
1310413096
getParticipants,
1310513097
getPendingChatMembers,
13106-
getReportPendingFields,
1310713098
getPersonalDetailsForAccountID,
1310813099
getPolicyDescriptionText,
1310913100
getPolicyExpenseChat,

src/libs/SearchUIUtils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ import {
104104
getPolicyName,
105105
getReportName,
106106
getReportOrDraftReport,
107-
getReportPendingFields,
108107
getReportStatusTranslation,
109108
getSearchReportName,
110109
hasAnyViolations,
@@ -1905,14 +1904,14 @@ function getReportSections({
19051904

19061905
const formattedFrom = formatPhoneNumber(getDisplayNameOrDefault(fromDetails));
19071906
const formattedTo = !shouldShowBlankTo ? formatPhoneNumber(getDisplayNameOrDefault(toDetails)) : '';
1907+
19081908
const formattedStatus = getReportStatusTranslation({stateNum: reportItem.stateNum, statusNum: reportItem.statusNum, translate});
19091909

19101910
const allReportTransactions = getTransactionsForReport(data, reportItem.reportID);
19111911
const policyFromKey = getPolicyFromKey(data, reportItem);
19121912
const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${reportItem?.policyID ?? String(CONST.DEFAULT_NUMBER_ID)}`] ?? policyFromKey;
19131913

1914-
const pendingFields = getReportPendingFields(reportItem.reportID);
1915-
const isReportStatePending = pendingFields?.nextStep === CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE;
1914+
const isReportStatePending = reportItem?.pendingFields?.nextStep === CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE;
19161915

19171916
const hasAnyViolationsForReport = hasAnyViolations(
19181917
reportItem.reportID,

0 commit comments

Comments
 (0)