Skip to content
Snippets Groups Projects
Verified Commit 3da6192a authored by Ciarán Ainsworth's avatar Ciarán Ainsworth Committed by Eliot Berriot
Browse files

Resolve "Hide favorites radios when user does not have any favorites"

parent 69d10461
No related branches found
No related tags found
No related merge requests found
Favorites radio will not be visible if the user does not have any favorites (#419)
\ No newline at end of file
......@@ -16,7 +16,7 @@
1 favorite
</translate>
</h2>
<radio-button type="favorites"></radio-button>
<radio-button v-if="hasFavorites" type="favorites"></radio-button>
</section>
<section class="ui vertical stripe segment">
<div :class="['ui', {'loading': isLoading}, 'form']">
......@@ -115,7 +115,10 @@ export default {
return {
title: this.$pgettext('Head/Favorites/Title', 'Your Favorites')
}
}
},
hasFavorites () {
return this.$store.state.favorites.count > 0
},
},
methods: {
updateQueryString: function() {
......
......@@ -10,7 +10,7 @@
<translate translate-context="Content/Radio/Title">Instance radios</translate>
</h3>
<div class="ui cards">
<radio-card v-if="$store.state.auth.authenticated" :type="'favorites'"></radio-card>
<radio-card v-if="isAuthenticated && hasFavorites" :type="'favorites'"></radio-card>
<radio-card :type="'random'"></radio-card>
<radio-card v-if="$store.state.auth.authenticated" :type="'less-listened'"></radio-card>
</div>
......@@ -144,7 +144,13 @@ export default {
searchPlaceholder,
title
}
}
},
isAuthenticated () {
return this.$store.state.auth.authenticated
},
hasFavorites () {
return this.$store.state.favorites.count > 0
},
},
methods: {
updateQueryString: _.debounce(function() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment