Skip to content

Commit c443fc5

Browse files
authored
Merge pull request Expensify#69199 from Expensify/chuckdries/revert-sync-drafts-2
Manual Revert "Merge pull request Expensify#67599 from Expensify/chuckdries/sync-drafts-2"
2 parents a4e1328 + 142fe74 commit c443fc5

35 files changed

Lines changed: 205 additions & 268 deletions

src/ONYXKEYS.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,6 @@ const ONYXKEYS = {
569569
NVP_LAST_ECASH_ANDROID_LOGIN: 'nvp_lastECashAndroidLogin',
570570
NVP_LAST_ANDROID_LOGIN: 'nvp_lastAndroidLogin',
571571

572-
/** Draft report comments */
573-
NVP_DRAFT_REPORT_COMMENTS: 'nvp_draftReportComments',
574-
575572
/** Stores the last created distance expense type (map or manual) */
576573
NVP_LAST_DISTANCE_EXPENSE_TYPE: 'nvp_lastDistanceExpenseType',
577574

@@ -607,8 +604,7 @@ const ONYXKEYS = {
607604
REPORT_ACTIONS_DRAFTS: 'reportActionsDrafts_',
608605
REPORT_ACTIONS_PAGES: 'reportActionsPages_',
609606
REPORT_ACTIONS_REACTIONS: 'reportActionsReactions_',
610-
/** @deprecated */
611-
REPORT_DRAFT_COMMENT: 'reportDraftComment_', // eslint-disable-line deprecation/deprecation
607+
REPORT_DRAFT_COMMENT: 'reportDraftComment_',
612608
REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_',
613609
REPORT_USER_IS_TYPING: 'reportUserIsTyping_',
614610
REPORT_USER_IS_LEAVING_ROOM: 'reportUserIsLeavingRoom_',
@@ -1014,7 +1010,6 @@ type OnyxCollectionValuesMapping = {
10141010
[ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS]: OnyxTypes.ReportActionsDrafts;
10151011
[ONYXKEYS.COLLECTION.REPORT_ACTIONS_PAGES]: OnyxTypes.Pages;
10161012
[ONYXKEYS.COLLECTION.REPORT_ACTIONS_REACTIONS]: OnyxTypes.ReportActionReactions;
1017-
// eslint-disable-next-line deprecation/deprecation
10181013
[ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT]: string;
10191014
[ONYXKEYS.COLLECTION.REPORT_IS_COMPOSER_FULL_SIZE]: boolean;
10201015
[ONYXKEYS.COLLECTION.REPORT_USER_IS_TYPING]: OnyxTypes.ReportUserIsTyping;
@@ -1241,7 +1236,6 @@ type OnyxValuesMapping = {
12411236
[ONYXKEYS.ONBOARDING_USER_REPORTED_INTEGRATION]: OnboardingAccounting;
12421237
[ONYXKEYS.HYBRID_APP]: OnyxTypes.HybridApp;
12431238
[ONYXKEYS.NVP_CSV_EXPORT_LAYOUTS]: Record<string, OnyxTypes.ExportTemplate>;
1244-
[ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS]: OnyxTypes.DraftReportComments;
12451239
[ONYXKEYS.NVP_LAST_DISTANCE_EXPENSE_TYPE]: DistanceExpenseType;
12461240
};
12471241

src/components/LHNOptionsList/LHNOptionsList.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import useRootNavigationState from '@hooks/useRootNavigationState';
1919
import useScrollEventEmitter from '@hooks/useScrollEventEmitter';
2020
import useTheme from '@hooks/useTheme';
2121
import useThemeStyles from '@hooks/useThemeStyles';
22+
import {isValidDraftComment} from '@libs/DraftCommentUtils';
2223
import getPlatform from '@libs/getPlatform';
2324
import Log from '@libs/Log';
2425
import {getIOUReportIDOfLastAction, getLastMessageTextForReport} from '@libs/OptionsListUtils';
@@ -52,7 +53,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
5253
const [policy] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: false});
5354
const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {canBeMissing: true});
5455
const [transactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: false});
55-
const [draftComments] = useOnyx(ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS, {canBeMissing: true});
56+
const [draftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: false});
5657
const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: false});
5758
const [dismissedProductTraining, dismissedProductTrainingMetadata] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {canBeMissing: true});
5859
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID, {canBeMissing: true});
@@ -188,7 +189,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
188189
? (getOriginalMessage(itemParentReportAction)?.IOUTransactionID ?? CONST.DEFAULT_NUMBER_ID)
189190
: CONST.DEFAULT_NUMBER_ID;
190191
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`];
191-
const hasDraftComment = !!draftComments?.[reportID];
192+
const hasDraftComment = isValidDraftComment(draftComments?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`]);
192193

193194
const isReportArchived = !!itemReportNameValuePairs?.private_isArchived;
194195
const canUserPerformWrite = canUserPerformWriteAction(item, isReportArchived);
@@ -287,6 +288,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
287288
policy,
288289
personalDetails,
289290
data.length,
291+
draftComments,
290292
optionMode,
291293
preferredLocale,
292294
transactions,
@@ -303,6 +305,7 @@ function LHNOptionsList({style, contentContainerStyles, data, onSelectRow, optio
303305
policy,
304306
personalDetails,
305307
data.length,
308+
draftComments,
306309
optionMode,
307310
preferredLocale,
308311
transactions,

src/hooks/useDiffPrevious.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/hooks/usePriorityChange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import usePrevious from './usePrevious';
77

88
function usePriorityMode() {
99
const [priorityMode] = useOnyx(ONYXKEYS.NVP_PRIORITY_MODE, {canBeMissing: true});
10-
const [allReportsWithDraftComments] = useOnyx(ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS, {canBeMissing: true});
10+
const [allReportsWithDraftComments] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
1111
const prevPriorityMode = usePrevious(priorityMode);
1212

1313
useEffect(() => {

src/hooks/useSidebarOrderedReports.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import SidebarUtils from '@libs/SidebarUtils';
77
import CONST from '@src/CONST';
88
import ONYXKEYS from '@src/ONYXKEYS';
99
import type * as OnyxTypes from '@src/types/onyx';
10-
import {getEmptyObject} from '@src/types/utils/EmptyObject';
1110
import mapOnyxCollectionItems from '@src/utils/mapOnyxCollectionItems';
1211
import useCurrentReportID from './useCurrentReportID';
1312
import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails';
1413
import useDeepCompareRef from './useDeepCompareRef';
15-
import useDiffPrevious from './useDiffPrevious';
1614
import useLocalize from './useLocalize';
1715
import useOnyx from './useOnyx';
1816
import usePrevious from './usePrevious';
@@ -68,8 +66,7 @@ function SidebarOrderedReportsContextProvider({
6866
const [transactions, {sourceValue: transactionsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION, {canBeMissing: true});
6967
const [transactionViolations, {sourceValue: transactionViolationsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, {canBeMissing: true});
7068
const [reportNameValuePairs, {sourceValue: reportNameValuePairsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS, {canBeMissing: true});
71-
const [drafts = getEmptyObject<OnyxTypes.DraftReportComments>()] = useOnyx(ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS, {canBeMissing: true});
72-
const reportsDraftsUpdates = useDiffPrevious(drafts);
69+
const [, {sourceValue: reportsDraftsUpdates}] = useOnyx(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, {canBeMissing: true});
7370
const [betas] = useOnyx(ONYXKEYS.BETAS, {canBeMissing: true});
7471
const [reportAttributes] = useOnyx(ONYXKEYS.DERIVED.REPORT_ATTRIBUTES, {selector: (value) => value?.reports, canBeMissing: true});
7572
const [currentReportsToDisplay, setCurrentReportsToDisplay] = useState<ReportsToDisplayInLHN>({});
@@ -102,8 +99,8 @@ function SidebarOrderedReportsContextProvider({
10299
reportsToUpdate = Object.keys(transactionViolationsUpdates ?? {})
103100
.map((key) => key.replace(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, ONYXKEYS.COLLECTION.TRANSACTION))
104101
.map((key) => `${ONYXKEYS.COLLECTION.REPORT}${transactions?.[key]?.reportID}`);
105-
} else if (reportsDraftsUpdates.length > 0) {
106-
reportsToUpdate = reportsDraftsUpdates.map((key) => `${ONYXKEYS.COLLECTION.REPORT}${key}`);
102+
} else if (reportsDraftsUpdates) {
103+
reportsToUpdate = Object.keys(reportsDraftsUpdates).map((key) => key.replace(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT, ONYXKEYS.COLLECTION.REPORT));
107104
} else if (policiesUpdates) {
108105
const updatedPolicies = Object.keys(policiesUpdates).map((key) => key.replace(ONYXKEYS.COLLECTION.POLICY, ''));
109106
reportsToUpdate = Object.entries(chatReports ?? {})
@@ -154,10 +151,10 @@ function SidebarOrderedReportsContextProvider({
154151
derivedCurrentReportID,
155152
priorityMode === CONST.PRIORITY_MODE.GSD,
156153
betas,
154+
policies,
157155
transactionViolations,
158156
reportNameValuePairs,
159157
reportAttributes,
160-
drafts,
161158
);
162159
} else {
163160
reportsToDisplay = SidebarUtils.getReportsToDisplayInLHN(
@@ -169,13 +166,12 @@ function SidebarOrderedReportsContextProvider({
169166
transactionViolations,
170167
reportNameValuePairs,
171168
reportAttributes,
172-
drafts,
173169
);
174170
}
175171
return reportsToDisplay;
176172
// Rule disabled intentionally — triggering a re-render on currentReportsToDisplay would cause an infinite loop
177173
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
178-
}, [getUpdatedReports, chatReports, derivedCurrentReportID, priorityMode, betas, policies, transactionViolations, reportNameValuePairs, reportAttributes, reportsDraftsUpdates]);
174+
}, [getUpdatedReports, chatReports, derivedCurrentReportID, priorityMode, betas, policies, transactionViolations, reportNameValuePairs, reportAttributes]);
179175

180176
const deepComparedReportsToDisplayInLHN = useDeepCompareRef(reportsToDisplayInLHN);
181177

@@ -184,7 +180,7 @@ function SidebarOrderedReportsContextProvider({
184180
}, [reportsToDisplayInLHN]);
185181

186182
const getOrderedReportIDs = useCallback(
187-
() => SidebarUtils.sortReportsToDisplayInLHN(deepComparedReportsToDisplayInLHN ?? {}, priorityMode, localeCompare, reportNameValuePairs, reportAttributes, drafts),
183+
() => SidebarUtils.sortReportsToDisplayInLHN(deepComparedReportsToDisplayInLHN ?? {}, priorityMode, localeCompare, reportNameValuePairs, reportAttributes),
188184
// Rule disabled intentionally - reports should be sorted only when the reportsToDisplayInLHN changes
189185
// eslint-disable-next-line react-compiler/react-compiler, react-hooks/exhaustive-deps
190186
[reportsToDisplayInLHN, localeCompare],

src/libs/API/parameters/SaveReportDraftCommentParams.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/libs/API/parameters/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,4 +420,3 @@ export type {default as OpenUnreportedExpensesPageParams} from './OpenUnreported
420420
export type {default as VerifyTestDriveRecipientParams} from './VerifyTestDriveRecipientParams';
421421
export type {default as ExportSearchWithTemplateParams} from './ExportSearchWithTemplateParams';
422422
export type {default as AssignReportToMeParams} from './AssignReportToMeParams';
423-
export type {default as SaveReportDraftCommentParams} from './SaveReportDraftCommentParams';

src/libs/API/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type UpdateBeneficialOwnersForBankAccountParams from './parameters/Update
1111
type ApiRequestType = ValueOf<typeof CONST.API_REQUEST_TYPE>;
1212

1313
const WRITE_COMMANDS = {
14-
SAVE_REPORT_DRAFT_COMMENT: 'SaveReportDraftComment',
1514
CLEAN_POLICY_TAGS: 'ClearPolicyTags',
1615
IMPORT_MULTI_LEVEL_TAGS: 'ImportMultiLevelTags',
1716
SET_WORKSPACE_AUTO_REPORTING_FREQUENCY: 'SetWorkspaceAutoReportingFrequency',
@@ -863,7 +862,6 @@ type WriteCommandParameters = {
863862
[WRITE_COMMANDS.FINISH_CORPAY_BANK_ACCOUNT_ONBOARDING]: Parameters.FinishCorpayBankAccountOnboardingParams;
864863
[WRITE_COMMANDS.DELETE_VACATION_DELEGATE]: null;
865864
[WRITE_COMMANDS.REOPEN_REPORT]: Parameters.ReopenReportParams;
866-
[WRITE_COMMANDS.SAVE_REPORT_DRAFT_COMMENT]: Parameters.SaveReportDraftCommentParams;
867865

868866
[WRITE_COMMANDS.DELETE_MONEY_REQUEST_ON_SEARCH]: Parameters.DeleteMoneyRequestOnSearchParams;
869867
[WRITE_COMMANDS.HOLD_MONEY_REQUEST_ON_SEARCH]: Parameters.HoldMoneyRequestOnSearchParams;

src/libs/DraftCommentUtils.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import type {OnyxEntry} from 'react-native-onyx';
1+
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
22
import Onyx from 'react-native-onyx';
33
import ONYXKEYS from '@src/ONYXKEYS';
4-
import type {DraftReportComments} from '@src/types/onyx';
54

6-
let draftComments: OnyxEntry<DraftReportComments> = {};
5+
let draftCommentCollection: OnyxCollection<string> = {};
76
Onyx.connect({
8-
key: ONYXKEYS.NVP_DRAFT_REPORT_COMMENTS,
7+
key: ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT,
98
callback: (nextVal) => {
10-
draftComments = nextVal;
9+
draftCommentCollection = nextVal;
1110
},
11+
waitForCollectionCallback: true,
1212
});
1313

1414
/**
@@ -17,15 +17,22 @@ Onyx.connect({
1717
* A valid use-case of this function is outside React components, like in utility functions.
1818
*/
1919
function getDraftComment(reportID: string): OnyxEntry<string> | null | undefined {
20-
return draftComments?.[reportID];
20+
return draftCommentCollection?.[ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT + reportID];
21+
}
22+
23+
/**
24+
* Returns true if the report has a valid draft comment.
25+
* A valid draft comment is a non-empty string.
26+
*/
27+
function isValidDraftComment(comment?: string | null): boolean {
28+
return !!comment;
2129
}
2230

2331
/**
2432
* Returns true if the report has a valid draft comment.
25-
* NOTE: please prefer useOnyx when possible
2633
*/
2734
function hasValidDraftComment(reportID: string): boolean {
28-
return !!getDraftComment(reportID);
35+
return isValidDraftComment(getDraftComment(reportID));
2936
}
3037

3138
/**
@@ -37,4 +44,4 @@ function prepareDraftComment(comment: string | null) {
3744
return comment || null;
3845
}
3946

40-
export {getDraftComment, hasValidDraftComment, prepareDraftComment};
47+
export {getDraftComment, isValidDraftComment, hasValidDraftComment, prepareDraftComment};

src/libs/SidebarUtils.ts

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,15 @@ import type {LocaleContextProps} from '@components/LocaleContextProvider';
66
import type {PartialPolicyForSidebar, ReportsToDisplayInLHN} from '@hooks/useSidebarOrderedReports';
77
import CONST from '@src/CONST';
88
import ONYXKEYS from '@src/ONYXKEYS';
9-
import type {
10-
Card,
11-
DraftReportComments,
12-
PersonalDetails,
13-
PersonalDetailsList,
14-
ReportActions,
15-
ReportAttributesDerivedValue,
16-
ReportNameValuePairs,
17-
Transaction,
18-
TransactionViolation,
19-
} from '@src/types/onyx';
9+
import type {Card, PersonalDetails, PersonalDetailsList, ReportActions, ReportAttributesDerivedValue, ReportNameValuePairs, Transaction, TransactionViolation} from '@src/types/onyx';
2010
import type Beta from '@src/types/onyx/Beta';
2111
import type {ReportAttributes} from '@src/types/onyx/DerivedValues';
2212
import type {Errors} from '@src/types/onyx/OnyxCommon';
2313
import type Policy from '@src/types/onyx/Policy';
2414
import type PriorityMode from '@src/types/onyx/PriorityMode';
2515
import type Report from '@src/types/onyx/Report';
2616
import type ReportAction from '@src/types/onyx/ReportAction';
17+
import {hasValidDraftComment} from './DraftCommentUtils';
2718
import {translateLocal} from './Localize';
2819
import {getLastActorDisplayName, getLastMessageTextForReport, getPersonalDetailsForAccountIDs, shouldShowLastActorDisplayName} from './OptionsListUtils';
2920
import Parser from './Parser';
@@ -188,7 +179,6 @@ function shouldDisplayReportInLHN(
188179
transactionViolations: OnyxCollection<TransactionViolation[]>,
189180
isReportArchived?: boolean,
190181
reportAttributes?: ReportAttributesDerivedValue['reports'],
191-
draftReportComments?: DraftReportComments,
192182
) {
193183
if (!report) {
194184
return {shouldDisplay: false};
@@ -219,12 +209,7 @@ function shouldDisplayReportInLHN(
219209
// Check if report should override hidden status
220210
const isSystemChat = isSystemChatUtil(report);
221211
const shouldOverrideHidden =
222-
!!draftReportComments?.[report.reportID] ||
223-
hasErrorsOtherThanFailedReceipt ||
224-
isFocused ||
225-
isSystemChat ||
226-
!!report.isPinned ||
227-
reportAttributes?.[report?.reportID]?.requiresAttention;
212+
hasValidDraftComment(report.reportID) || hasErrorsOtherThanFailedReceipt || isFocused || isSystemChat || !!report.isPinned || reportAttributes?.[report?.reportID]?.requiresAttention;
228213

229214
if (isHidden && !shouldOverrideHidden) {
230215
return {shouldDisplay: false};
@@ -255,7 +240,6 @@ function getReportsToDisplayInLHN(
255240
transactionViolations: OnyxCollection<TransactionViolation[]>,
256241
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
257242
reportAttributes?: ReportAttributesDerivedValue['reports'],
258-
draftReportComments?: DraftReportComments,
259243
) {
260244
const isInFocusMode = priorityMode === CONST.PRIORITY_MODE.GSD;
261245
const allReportsDictValues = reports ?? {};
@@ -275,7 +259,6 @@ function getReportsToDisplayInLHN(
275259
transactionViolations,
276260
isArchivedReport(reportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`]),
277261
reportAttributes,
278-
draftReportComments,
279262
);
280263

281264
if (shouldDisplay) {
@@ -293,10 +276,10 @@ function updateReportsToDisplayInLHN(
293276
currentReportId: string | undefined,
294277
isInFocusMode: boolean,
295278
betas: OnyxEntry<Beta[]>,
279+
policies: OnyxCollection<PartialPolicyForSidebar>,
296280
transactionViolations: OnyxCollection<TransactionViolation[]>,
297281
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
298282
reportAttributes?: ReportAttributesDerivedValue['reports'],
299-
draftReportComments?: DraftReportComments,
300283
) {
301284
const displayedReportsCopy = {...displayedReports};
302285
updatedReportsKeys.forEach((reportID) => {
@@ -314,7 +297,6 @@ function updateReportsToDisplayInLHN(
314297
transactionViolations,
315298
isArchivedReport(reportNameValuePairs?.[`${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${report.reportID}`]),
316299
reportAttributes,
317-
draftReportComments,
318300
);
319301

320302
if (shouldDisplay) {
@@ -333,7 +315,6 @@ function categorizeReportsForLHN(
333315
reportsToDisplay: ReportsToDisplayInLHN,
334316
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
335317
reportAttributes?: ReportAttributesDerivedValue['reports'],
336-
draftReportComments?: DraftReportComments,
337318
) {
338319
const pinnedAndGBRReports: MiniReport[] = [];
339320
const errorReports: MiniReport[] = [];
@@ -369,7 +350,7 @@ function categorizeReportsForLHN(
369350
const isPinned = !!report.isPinned;
370351
const requiresAttention = !!reportAttributes?.[reportID]?.requiresAttention;
371352
const hasErrors = !!report.hasErrorsOtherThanFailedReceipt;
372-
const hasDraft = !!reportID && !!draftReportComments?.[reportID];
353+
const hasDraft = reportID ? hasValidDraftComment(reportID) : false;
373354
const reportNameValuePairsKey = `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`;
374355
const rNVPs = reportNameValuePairs?.[reportNameValuePairsKey];
375356
const isArchived = isArchivedNonExpenseReport(report, !!rNVPs?.private_isArchived);
@@ -494,7 +475,6 @@ function sortReportsToDisplayInLHN(
494475
localeCompare: LocaleContextProps['localeCompare'],
495476
reportNameValuePairs?: OnyxCollection<ReportNameValuePairs>,
496477
reportAttributes?: ReportAttributesDerivedValue['reports'],
497-
draftReportComments?: DraftReportComments,
498478
): string[] {
499479
Performance.markStart(CONST.TIMING.GET_ORDERED_REPORT_IDS);
500480

@@ -512,7 +492,7 @@ function sortReportsToDisplayInLHN(
512492
// - Sorted by reportDisplayName in GSD (focus) view mode
513493

514494
// Step 1: Categorize reports
515-
const categories = categorizeReportsForLHN(reportsToDisplay, reportNameValuePairs, reportAttributes, draftReportComments);
495+
const categories = categorizeReportsForLHN(reportsToDisplay, reportNameValuePairs, reportAttributes);
516496

517497
// Step 2: Sort each category
518498
const sortedCategories = sortCategorizedReports(categories, isInDefaultMode, localeCompare);

0 commit comments

Comments
 (0)