Skip to content

Commit

Permalink
Fix single Invoice (not invoice) and other finalisable items still sh…
Browse files Browse the repository at this point in the history
…owing badge count

Addresses #507
  • Loading branch information
Sworup Shakya committed Sep 9, 2019
1 parent fec67a5 commit 269b556
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/widgets/NavigationBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class NavigationBar extends React.Component {

componentWillReceiveProps(props) {
const dataType = this.getDataTypeFromRouteName(props);
if (dataType) this.refreshData(dataType);
this.refreshData(dataType);
}

getDataTypeFromRouteName(props) {
Expand All @@ -40,9 +40,12 @@ export class NavigationBar extends React.Component {
}

refreshData = (dataType) => {
const unfinalisedCount = dataType != '' ?
this.props.database.objects(dataType).filtered('status != "finalised"').length :
0;

this.setState({
unfinalisedCount: this.props.database
.objects(dataType).filtered('status != "finalised"').length,
unfinalisedCount: unfinalisedCount,
});
}

Expand Down

0 comments on commit 269b556

Please sign in to comment.