Skip to content

Commit

Permalink
fixing eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abzokhattab committed Jan 9, 2025
1 parent 36d4391 commit 89adf37
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 95 deletions.
2 changes: 1 addition & 1 deletion src/components/EReceiptThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type IconSize = 'x-small' | 'small' | 'medium' | 'large';
type EReceiptThumbnailProps = EReceiptThumbnailOnyxProps & {
/** TransactionID of the transaction this EReceipt corresponds to. It's used by withOnyx HOC */
// eslint-disable-next-line react/no-unused-prop-types
transactionID: string;
transactionID: string | undefined;

/** Border radius to be applied on the parent view. */
borderRadius?: number;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReceiptEmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type ReceiptEmptyStateProps = {

shouldAllowReceiptDrop?: boolean;

transactionID: string;
transactionID: string | undefined;
};

// Returns an SVG icon indicating that the user should attach a receipt
Expand Down
4 changes: 2 additions & 2 deletions src/components/ReceiptImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function ReceiptImage({
isThumbnail
onPress={onPress}
disabled={!onPress}
transactionID={transactionID ?? '-1'}
transactionID={transactionID}
/>
);
}
Expand All @@ -133,7 +133,7 @@ function ReceiptImage({
return (
<View style={style ?? [styles.w100, styles.h100]}>
<EReceiptThumbnail
transactionID={transactionID ?? '-1'}
transactionID={transactionID}
iconSize={iconSize}
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
Expand Down
200 changes: 113 additions & 87 deletions src/components/ReportActionItem/MoneyRequestView.tsx

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3394,13 +3394,16 @@ function updateMoneyRequestDate(

/** Updates the billable field of an expense */
function updateMoneyRequestBillable(
transactionID: string,
transactionThreadReportID: string,
transactionID: string | undefined,
transactionThreadReportID: string | undefined,
value: boolean,
policy: OnyxEntry<OnyxTypes.Policy>,
policyTagList: OnyxEntry<OnyxTypes.PolicyTagLists>,
policyCategories: OnyxEntry<OnyxTypes.PolicyCategories>,
) {
if (!transactionID || !transactionThreadReportID) {
return;
}
const transactionChanges: TransactionChanges = {
billable: value,
};
Expand Down
6 changes: 5 additions & 1 deletion src/libs/actions/ReportActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ function clearReportActionErrors(reportID: string, reportAction: ReportAction, k
ignore: `undefined` means we want to check both parent and children report actions
ignore: `parent` or `child` means we want to ignore checking parent or child report actions because they've been previously checked
*/
function clearAllRelatedReportActionErrors(reportID: string, reportAction: ReportAction | null | undefined, ignore?: IgnoreDirection, keys?: string[]) {
function clearAllRelatedReportActionErrors(reportID: string | undefined, reportAction: ReportAction | null | undefined, ignore?: IgnoreDirection, keys?: string[]) {
if (!reportID) {
return;
}

const errorKeys = keys ?? Object.keys(reportAction?.errors ?? {});
if (!reportAction || errorKeys.length === 0) {
return;
Expand Down
5 changes: 4 additions & 1 deletion src/libs/actions/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,10 @@ function abandonReviewDuplicateTransactions() {
Onyx.set(ONYXKEYS.REVIEW_DUPLICATES, null);
}

function clearError(transactionID: string) {
function clearError(transactionID: string | undefined) {
if (!transactionID) {
return;
}
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {errors: null, errorFields: {route: null, waypoints: null, routes: null}});
}

Expand Down

0 comments on commit 89adf37

Please sign in to comment.