Skip to content

Commit

Permalink
list query filter
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Aug 16, 2017
1 parent c48c4f6 commit 31cbe76
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/widgets/list/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class List extends Component {
}

updateQuery(props) {
this.query = { ...(this.query || emptyQuery) }
this.query = { ...emptyQuery }
const newQuery = props.query || {}
for (const i in this.query) {
if (newQuery[i] != null) {
Expand Down Expand Up @@ -79,11 +79,9 @@ export class List extends Component {
this.loadReaction = reaction(() => store.records.map((record) => record.id), ids => this.loadData())
}
componentWillReceiveProps(nextProps) {
if (this.props.query != nextProps.query) {
this.loadData(nextProps);
} else if (this.props.entityName !== nextProps.entityName) {
this.loadData(nextProps)
}
this.updateQuery(nextProps)
this.syncQueryToUrl()
this.loadData(nextProps);
}
componentWillUnmount() {
this.loadReaction()
Expand Down

0 comments on commit 31cbe76

Please sign in to comment.