Rename areStatesEqual to areObjectsEqual and make it more comprehensive and accurate.

Этот коммит содержится в:
JoramWilander
2015-11-12 11:19:59 -05:00
родитель 13a251a5ee
Коммит 50815f9be7
28 изменённых файлов: 138 добавлений и 47 удалений

Просмотреть файл

@@ -173,7 +173,7 @@ export default class Sidebar extends React.Component {
window.addEventListener('resize', this.handleResize);
}
shouldComponentUpdate(nextProps, nextState) {
if (!Utils.areStatesEqual(nextState, this.state)) {
if (!Utils.areObjectsEqual(nextState, this.state)) {
return true;
}
return false;
@@ -205,10 +205,7 @@ export default class Sidebar extends React.Component {
}
}
onChange() {
var newState = this.getStateFromStores();
if (!Utils.areStatesEqual(newState, this.state)) {
this.setState(newState);
}
this.setState(this.getStateFromStores());
}
updateTitle() {
const channel = ChannelStore.getCurrent();