Skip to content

Commit

Permalink
🐛 fix account filters being overridden (#3441)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatissJanis authored Sep 16, 2024
1 parent bdbf6e9 commit fefd1be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/desktop-client/src/components/accounts/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,18 @@ class AccountInternal extends PureComponent<

onApplyFilter = async (conditionOrSavedFilter: ConditionEntity) => {
let filterConditions = this.state.filterConditions;

if (
'customName' in conditionOrSavedFilter &&
conditionOrSavedFilter.customName
) {
filterConditions = filterConditions.filter(
c =>
!isTransactionFilterEntity(c) &&
c.customName !== conditionOrSavedFilter.customName,
);
}

if (isTransactionFilterEntity(conditionOrSavedFilter)) {
// A saved filter was passed in.
const savedFilter = conditionOrSavedFilter;
Expand All @@ -1366,12 +1378,6 @@ class AccountInternal extends PureComponent<
this.setState({ filterConditionsOp: savedFilter.conditionsOp });
this.applyFilters([...savedFilter.conditions]);
} else {
filterConditions = filterConditions.filter(
c =>
!isTransactionFilterEntity(c) &&
c.customName !== conditionOrSavedFilter.customName,
);

// A condition was passed in.
const condition = conditionOrSavedFilter;
this.setState({
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/3441.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MatisJanis]
---

Fix account filters being overridden.

0 comments on commit fefd1be

Please sign in to comment.