Skip to content
Closed
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5cbc1e9
fix: edit comment option is show for doc file
lorretheboy Nov 26, 2025
871f999
chore: merge main
lorretheboy Dec 4, 2025
9143506
chore: optimize code
lorretheboy Dec 4, 2025
36dd735
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Feb 6, 2026
e9647be
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Feb 8, 2026
e12dfe1
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Feb 16, 2026
b181d17
fix: behavior
lorretheboy Feb 16, 2026
4503eb1
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Mar 8, 2026
0dd9742
chore: revert
lorretheboy Mar 8, 2026
4c996ee
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Mar 10, 2026
8238b1d
fix: logic
lorretheboy Mar 10, 2026
adf506b
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Mar 18, 2026
6acacaa
fix: prettier
lorretheboy Mar 18, 2026
5fb9c93
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Mar 19, 2026
4ece1e4
fix: approach
lorretheboy Mar 19, 2026
2535856
fix: approach
lorretheboy Mar 19, 2026
b667abf
fix: revert to original logic
lorretheboy Mar 19, 2026
1d96c61
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Mar 23, 2026
9ccdec4
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Mar 26, 2026
8d861ac
Merge branch 'main' of https://github.com/Expensify/App into fix/74031
lorretheboy Mar 30, 2026
19553be
fix: new approach
lorretheboy Mar 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
import getAttachmentDetails from './fileDownload/getAttachmentDetails';
import type {FormulaContext} from './Formula';
import getBase62ReportID from './getBase62ReportID';
import {isReportMessageAttachment} from './isReportMessageAttachment';
import {formatPhoneNumber as formatPhoneNumberPhoneUtils} from './LocalePhoneNumber';
// eslint-disable-next-line @typescript-eslint/no-deprecated
import {translateLocal} from './Localize';
Expand Down Expand Up @@ -1058,7 +1057,7 @@
};

let conciergeReportIDOnyxConnect: OnyxEntry<string>;
Onyx.connect({

Check warning on line 1060 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => {
conciergeReportIDOnyxConnect = value;
Expand All @@ -1066,7 +1065,7 @@
});

const defaultAvatarBuildingIconTestID = 'SvgDefaultAvatarBuilding Icon';
Onyx.connect({

Check warning on line 1068 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -1084,7 +1083,7 @@
let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
let allPersonalDetailLogins: string[];
let currentUserPersonalDetails: OnyxEntry<PersonalDetails>;
Onyx.connect({

Check warning on line 1086 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (deprecatedCurrentUserAccountID) {
Expand All @@ -1096,7 +1095,7 @@
});

let allReportsDraft: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 1098 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
waitForCollectionCallback: true,
callback: (value) => (allReportsDraft = value),
Expand All @@ -1104,7 +1103,7 @@

let allPolicies: OnyxCollection<Policy>;
let policiesArray: Policy[] = [];
Onyx.connect({

Check warning on line 1106 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -1114,7 +1113,7 @@
});

let allPolicyDrafts: OnyxCollection<Policy>;
Onyx.connect({

Check warning on line 1116 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY_DRAFTS,
waitForCollectionCallback: true,
callback: (value) => (allPolicyDrafts = value),
Expand All @@ -1122,7 +1121,7 @@

let allReports: OnyxCollection<Report>;
let reportsByPolicyID: ReportByPolicyMap;
Onyx.connect({

Check warning on line 1124 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -1158,14 +1157,14 @@
});

let betaConfiguration: OnyxEntry<BetaConfiguration> = {};
Onyx.connect({

Check warning on line 1160 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETA_CONFIGURATION,
callback: (value) => (betaConfiguration = value ?? {}),
});

let deprecatedAllTransactions: OnyxCollection<Transaction> = {};
let deprecatedReportsTransactions: Record<string, Transaction[]> = {};
Onyx.connect({

Check warning on line 1167 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -1191,7 +1190,7 @@
});

let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 1193 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -5020,20 +5019,17 @@
* Can only edit if:
*
* - It was written by the current user
* - It's an ADD_COMMENT that is not an attachment
* - It's an ADD_COMMENT or IOU action
* - It's an expense where conditions for modifications are defined in canEditMoneyRequest method
* - It's not pending deletion
*/
function canEditReportAction(reportAction: OnyxInputOrEntry<ReportAction>): boolean {
const isCommentOrIOU = reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU;
const message = reportAction ? getReportActionMessageReportUtils(reportAction) : undefined;

return !!(
reportAction?.actorAccountID === deprecatedCurrentUserAccountID &&
isCommentOrIOU &&
(!isMoneyRequestAction(reportAction) || canEditMoneyRequest(reportAction)) && // Returns true for non-IOU actions
!isReportMessageAttachment(message) &&
((!reportAction.isAttachmentWithText && !reportAction.isAttachmentOnly) || !reportAction.isOptimisticAction) &&
!isDeletedAction(reportAction) &&
!isCreatedTaskReportAction(reportAction) &&
reportAction?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE
Expand Down
Loading