DocumentScene improvements

This commit is contained in:
Jori Lallo
2016-07-06 21:44:14 -07:00
parent 6f33caca45
commit e3d21ba882
2 changed files with 18 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
import _isEqual from 'lodash/isEqual';
import { observable, action, computed } from 'mobx';
import { client } from 'utils/ApiClient';
import { browserHistory } from 'react-router';
@@ -44,6 +45,11 @@ const store = new class DocumentSceneStore {
}
@action updateNavigationTree = async (tree) => {
// Only update when tree changes
if (_isEqual(toJS(tree), toJS(this.document.atlas.navigationTree))) {
return true;
}
this.isFetching = true;
try {
@@ -60,4 +66,4 @@ const store = new class DocumentSceneStore {
}
}();
export default store;
export default store;