Use computed for atlas detection
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user