Skip to content

Commit

Permalink
Using fetch transactions with filter parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkus committed Apr 3, 2024
1 parent deca5ef commit 6cb9434
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/desktop-client/src/components/accounts/Account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -659,20 +659,16 @@ class AccountInternal extends PureComponent {
}
break;
case 'toggle-reconciled':
const refilterTransactions = () => {
const filters = this.state.filters;
if (filters.length > 0) {
this.applyFilters([...filters]);
} else {
this.fetchTransactions();
}
};
if (this.state.showReconciled) {
this.props.savePrefs({ ['hide-reconciled-' + accountId]: true });
this.setState({ showReconciled: false }, refilterTransactions);
this.setState({ showReconciled: false }, () =>
this.fetchTransactions(this.state.filters),
);
} else {
this.props.savePrefs({ ['hide-reconciled-' + accountId]: false });
this.setState({ showReconciled: true }, refilterTransactions);
this.setState({ showReconciled: true }, () =>
this.fetchTransactions(this.state.filters),
);
}
break;
default:
Expand Down

0 comments on commit 6cb9434

Please sign in to comment.