Skip to content
Merged
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import * as Member from '@userActions/Policy/Member';
import * as Report from '@userActions/Report';
import * as ReportActions from '@userActions/ReportActions';
import * as Session from '@userActions/Session';
import * as Transaction from '@userActions/Transaction';
import * as User from '@userActions/User';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -925,7 +926,13 @@ function ReportActionItem({
)}
>
<OfflineWithFeedback
onClose={() => ReportActions.clearAllRelatedReportActionErrors(report.reportID, action)}
onClose={() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB we could declare a function for this to leave the render logic a bit cleaner

const transactionID = ReportActionsUtils.isMoneyRequestAction(action) ? ReportActionsUtils.getOriginalMessage(action)?.IOUTransactionID : undefined;
if (transactionID) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daledah, a small problem, do we also need to check if linkedTransactionRouteError is true here? This might help avoid unexpected action? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no feedback yet, and considering that clearAllRelatedReportActionErrors is also trying to clear all the errors in the action, I won’t let my previous concern be a blocker, and will fill the check list soon. :)

Transaction.clearError(transactionID);
}
ReportActions.clearAllRelatedReportActionErrors(report.reportID, action);
}}
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
pendingAction={
draftMessage !== undefined ? undefined : action.pendingAction ?? (action.isOptimisticAction ? CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD : undefined)
Expand Down