Skip to content

Commit

Permalink
Fix Sorting/Balance interactions (actualbudget#1406)
Browse files Browse the repository at this point in the history
  • Loading branch information
carkom authored Jul 28, 2023
1 parent 2f5264c commit e17c583
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
14 changes: 9 additions & 5 deletions packages/desktop-client/src/components/accounts/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -1047,13 +1047,13 @@ class AccountInternal extends PureComponent {
},
() => {
this.fetchTransactions();

if (this.state.sort.length !== 0) {
this.applySort();
}
},
);
}

if (this.state.sort.length !== 0) {
this.applySort();
}
};

applySort = (field, ascDesc, prevField, prevAscDesc) => {
Expand Down Expand Up @@ -1217,6 +1217,7 @@ class AccountInternal extends PureComponent {
showEmptyMessage={showEmptyMessage}
balanceQuery={balanceQuery}
canCalculateBalance={this.canCalculateBalance}
isSorted={this.state.sort.length !== 0}
reconcileAmount={reconcileAmount}
search={this.state.search}
filters={this.state.filters}
Expand Down Expand Up @@ -1265,7 +1266,7 @@ class AccountInternal extends PureComponent {
categoryGroups={categoryGroups}
payees={payees}
balances={allBalances}
showBalances={showBalances}
showBalances={!!allBalances}
showCleared={showCleared}
showAccount={
!accountId ||
Expand Down Expand Up @@ -1297,6 +1298,9 @@ class AccountInternal extends PureComponent {
</View>
) : null
}
onSort={this.onSort}
sortField={this.state.sort.field}
ascDesc={this.state.sort.ascDesc}
onChange={this.onTransactionsChange}
onRefetch={this.refetchTransactions}
onRefetchUpToRow={row =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ const TransactionHeader = memo(
}
/>
{showBalance && <Cell value="Balance" width={88} textAlign="right" />}
{showCleared && <Field width={30} truncate={false} />}
{showCleared && <Field width={23} truncate={false} />}
<Cell value="" width={5 + scrollWidth ?? 0} />
</Row>
);
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/1406.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [carkom]
---

Fix missed lines from previous merge that broke sorting.

0 comments on commit e17c583

Please sign in to comment.