Use computed for atlas detection

This commit is contained in:
Jori Lallo
2016-06-22 22:57:39 -07:00
parent 4c262500c1
commit 496e9214d5
2 changed files with 14 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import { observable, action } from 'mobx';
import { observable, action, computed } from 'mobx';
import { client } from 'utils/ApiClient';
import { browserHistory } from 'react-router';
@@ -8,6 +8,13 @@ const store = new class DocumentSceneStore {
@observable isFetching = true;
@observable isDeleting;
/* Computed */
@computed get isAtlas() {
console.log(this.document.atlas.type)
return this.document.atlas.type === 'atlas';
}
/* Actions */
@action fetchDocument = async (id) => {