Skip to content
Snippets Groups Projects
Commit f0ab2b75 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '419-hide-favorites-radios-when-user-does-not-have-any-favorites' into 'develop'

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

Closes #419

See merge request funkwhale/funkwhale!797
parents d029248f bf32f744
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