Limit categories per instance to 3

This commit is contained in:
Chocobozzz 2019-10-30 15:22:48 +01:00
parent a897dca4cc
commit dfcb2e26db
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -34,7 +34,7 @@
</div> </div>
<div class="tags"> <div class="tags">
<div class="tag" v-for="category in instance.categories" :key="category"> <div class="tag" v-for="category in limitedCategories" :key="category">
{{ translatedThemes[category] }} {{ translatedThemes[category] }}
</div> </div>
</div> </div>
@ -251,6 +251,12 @@
.map(l => this.translatedLanguages[l]) .map(l => this.translatedLanguages[l])
.filter(l => !!l) .filter(l => !!l)
.join(', ') .join(', ')
},
limitedCategories () {
if (Array.isArray(this.instance.categories) === false) return []
return this.instance.categories.slice(0, 3)
} }
}, },