Commit d41cf94e authored by Matija Obreza's avatar Matija Obreza

Trees: Keep showing JSON file-based trees

parent 240deb88
......@@ -93,7 +93,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
// todo: remove when migration to cropDetails.diversityTrees will be finished
if (typeof window !== 'undefined') {
if (cropDetails && cropDetails.files && cropDetails.shortName === shortName && (!cropDetails.diversityTrees || !cropDetails.diversityTrees.length)) {
if (cropDetails && cropDetails.files && cropDetails.shortName === shortName) {
console.log(`Crop files`, cropDetails.files);
const treeFiles = cropDetails.files && cropDetails.files.filter((file) => {
return file.contentType === 'application/json' && file.originalFilename.match(/tree\.json$/);
......@@ -114,7 +114,7 @@ class DisplayPage extends React.Component<IDisplayPageProps, any> {
const { cropDetails: currentCrop } = prevProps;
const { cropDetails, repositoryDownloadUrl } = this.props;
const { treesData } = this.state;
if (cropDetails && (! currentCrop || (currentCrop.shortName !== cropDetails.shortName)) && (!cropDetails.diversityTrees || !cropDetails.diversityTrees.length)) {
if (cropDetails && (! currentCrop || (currentCrop.shortName !== cropDetails.shortName))) {
console.log(`Crop files`, cropDetails.files);
const treeFiles = cropDetails.files && cropDetails.files.filter((file) => {
return file.contentType === 'application/json' && file.originalFilename.match(/tree\.json$/);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment