Skip to content

Commit

Permalink
Remove conditional code and move logic to server
Browse files Browse the repository at this point in the history
  • Loading branch information
MonilBhavsar committed Dec 3, 2024
1 parent d9e53c7 commit f5cd07f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/hooks/useViolations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,13 @@ const violationFields: Record<ViolationName, ViolationField> = {

type ViolationsMap = Map<ViolationField, TransactionViolation[]>;

// We don't want to show these violations on NewDot
const excludedViolationsName = ['taxAmountChanged', 'taxRateChanged'];

/**
* @param violations – List of transaction violations
* @param shouldShowOnlyViolations – Whether we should only show violations of type 'violation'
*/
function useViolations(violations: TransactionViolation[], shouldShowOnlyViolations: boolean) {
const violationsByField = useMemo((): ViolationsMap => {
const filteredViolations = violations.filter((violation) => {
if (excludedViolationsName.includes(violation.name)) {
return false;
}
if (shouldShowOnlyViolations) {
return violation.type === CONST.VIOLATION_TYPES.VIOLATION;
}
Expand Down

0 comments on commit f5cd07f

Please sign in to comment.