Skip to content

Commit

Permalink
prevent unnecessary category updates by checking name equality
Browse files Browse the repository at this point in the history
  • Loading branch information
huult committed Oct 30, 2024
1 parent 5f94883 commit 3a210ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libs/CategoryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ function getCategoryDefaultTaxRate(expenseRules: ExpenseRule[], categoryName: st
}

function updateCategoryInMccGroup(mccGroups: Record<string, MccGroup>, oldCategoryName: string, newCategoryName: string) {
if (oldCategoryName === newCategoryName) {
return mccGroups;
}

const updatedGroups: Record<string, MccGroup> = {};

for (const [key, group] of Object.entries(mccGroups || {})) {
Expand Down

0 comments on commit 3a210ad

Please sign in to comment.