Skip to content

Commit

Permalink
Fix explore mode page reload
Browse files Browse the repository at this point in the history
  • Loading branch information
mwbernard committed Nov 24, 2023
1 parent 78565c8 commit 09ec4ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions vacs-map-app/src/components/ExploreSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</optgroup>
</select>

<span> {{ selectedCropInfo.description }}</span>
<span> {{ selectedCropInfo?.description }}</span>
</div>

<div class="crop-fingerprint">crop fingerprint</div>
Expand Down Expand Up @@ -50,11 +50,11 @@ const { data: cropInformation } = storeToRefs(cropInformationStore)
const futureScenarios = computed(() => availableModels.value.filter((d) => d.startsWith('future')))
const selectedCropInfo = computed(() => {
return cropInformation.value.find(d => d.id === selectedCrop.value);
return cropInformation?.value?.find(d => d.id === selectedCrop.value);
})
const getCropsByGroup = (group) => {
return cropInformation.value.filter(crop => crop.crop_group === group);
return cropInformation?.value?.filter(crop => crop.crop_group === group);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const columns = computed(() => {
});
const selectedExtent = computed(() => {
if (!columns.value.length) return null;
if (!columns.value?.length) return null;
const extents = columns.value.map(c => cropYieldsStore.getExtent(c));
Expand Down

0 comments on commit 09ec4ae

Please sign in to comment.