Skip to content

A local-first personal finance app

Prevent duplicate filters from being applied (#6000)

parapsychicbb79f1243594
diff --git a/packages/desktop-client/src/components/accounts/Account.tsx b/packages/desktop-client/src/components/accounts/Account.tsx
index affb9bacbd..77509860d2 100644
--- a/packages/desktop-client/src/components/accounts/Account.tsx
+++ b/packages/desktop-client/src/components/accounts/Account.tsx
@@ -14,6 +14,7 @@ import { theme } from '@actual-app/components/theme';
import { View } from '@actual-app/components/view';
import { t } from 'i18next';
import debounce from 'lodash/debounce';
+import isEqual from 'lodash/isEqual';
import { v4 as uuidv4 } from 'uuid';
import { send, listen } from 'loot-core/platform/client/fetch';
@@ -1465,6 +1466,12 @@ class AccountInternal extends PureComponent<
} else {
// A condition was passed in.
const condition = conditionOrSavedFilter;
+ const isDuplicate = filterConditions.some(c => isEqual(c, condition));
+
+ if (isDuplicate) {
+ return;
+ }
+
this.setState({
filterId: {
...this.state.filterId,
diff --git a/upcoming-release-notes/6000.md b/upcoming-release-notes/6000.md
new file mode 100644
index 0000000000..8fd3389785
--- /dev/null
+++ b/upcoming-release-notes/6000.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [parapsychic]
+---
+
+Prevent duplicate filters from being applied