Skip to content

Commit

Permalink
Merge pull request #873 from c2corg/hotfix
Browse files Browse the repository at this point in the history
hot fix for map box
  • Loading branch information
cbeauchesne authored Nov 17, 2019
2 parents 039ac73 + acce11e commit fe981ff
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/views/document/utils/boxes/MapBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<div class="columns is-multiline is-mobile is-clearfix">
<div class="column is-full-tablet is-full-desktop is-half-widescreen ">
<router-link v-if="yetiDocumentActivities" :to="yetiUrl" class="button is-small">
<router-link v-if="showYetiButton" :to="yetiUrl" class="button is-small">
<icon-yeti class="icon" />
<span>Voir dans YETI</span>
</router-link>
Expand Down Expand Up @@ -61,8 +61,15 @@
mixins: [ requireDocumentProperty ],
computed: {
yetiDocumentActivities() {
showYetiButton() {
// at least one of document activities is concerned by yeti
if (!this.document || !this.document.activities) {
return false;
}
const activities = ['skitouring', 'snow_ice_mixed', 'ice_climbing', 'snowshoeing'];
return this.document.activities.some(activity => activities.includes(activity));
},
Expand Down

0 comments on commit fe981ff

Please sign in to comment.