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
environments/review-front-deve-otr6gc/deployments/1920
Eliot Berriot 2019-06-24 13:30:56 +02:00
commit f0ab2b7572
3 zmienionych plików z 14 dodań i 4 usunięć

Wyświetl plik

@ -0,0 +1 @@
Favorites radio will not be visible if the user does not have any favorites (#419)

Wyświetl plik

@ -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() {

Wyświetl plik

@ -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() {