Use loads directly

This commit is contained in:
Jori Lallo
2016-08-12 14:56:39 +02:00
parent a65cf1d429
commit b2d00f3384
4 changed files with 11 additions and 13 deletions

View File

@@ -1,6 +1,4 @@
import _isEqual from 'lodash/isEqual';
import _indexOf from 'lodash/indexOf';
import _without from 'lodash/without';
import _ from 'lodash';
import { observable, action, computed, runInAction, toJS, autorunAsync } from 'mobx';
import { client } from 'utils/ApiClient';
import { browserHistory } from 'react-router';
@@ -35,7 +33,7 @@ class DocumentSceneStore {
}
node.children = node.children.map(childNode => {
return collapseNodes(childNode);
})
});
return node;
};
@@ -83,7 +81,7 @@ class DocumentSceneStore {
@action updateNavigationTree = async (tree) => {
// Only update when tree changes
if (_isEqual(toJS(tree), toJS(this.document.collection.navigationTree))) {
if (_.isEqual(toJS(tree), toJS(this.document.collection.navigationTree))) {
return true;
}
@@ -105,8 +103,8 @@ class DocumentSceneStore {
}
@action onNodeCollapse = (nodeId, collapsed) => {
if (_indexOf(this.collapsedNodes, nodeId) >= 0) {
this.collapsedNodes = _without(this.collapsedNodes, nodeId);
if (_.indexOf(this.collapsedNodes, nodeId) >= 0) {
this.collapsedNodes = _.without(this.collapsedNodes, nodeId);
} else {
this.collapsedNodes.push(nodeId);
}