Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
trazyn committed Oct 30, 2017
1 parent 3bbd5fe commit 67b7349
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/js/pages/Contacts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import randomColor from 'randomcolor';
import classes from './style.css';

@inject(stores => ({
filtered: () => {
stores.contacts.filter('');
return stores.contacts.filtered;
},
filter: stores.contacts.filter,
filtered: stores.contacts.filtered,
getContats: stores.contacts.getContats,
showUserinfo: stores.userinfo.toggle,
}))
Expand Down Expand Up @@ -61,8 +59,12 @@ export default class Contacts extends Component {
});
}

componentWillMount() {
this.props.filter();
}

render() {
var { query, result } = this.props.filtered();
var { query, result } = this.props.filtered;

if (query && result.length === 0) {
return (
Expand Down
4 changes: 2 additions & 2 deletions src/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default () => {
return (
<Main>
<Route exact path="/" component={Home} />
<Route path="/contacts" component={Contacts} />
<Route path="/settings" component={Settings} />
<Route exact path="/contacts" component={Contacts} />
<Route exact path="/settings" component={Settings} />
</Main>
);
/* eslint-enable */
Expand Down
2 changes: 0 additions & 2 deletions src/js/stores/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ class Contacts {
query: text,
result: list.length ? self.group(list, showall) : [],
};

window.res = self.filtered;
}

@action toggleGroup(showGroup) {
Expand Down

0 comments on commit 67b7349

Please sign in to comment.