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
This commit is contained in:
		
						commit
						f0ab2b7572
					
				| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Favorites radio will not be visible if the user does not have any favorites (#419)
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,7 @@
 | 
				
			||||||
          1 favorite
 | 
					          1 favorite
 | 
				
			||||||
        </translate>
 | 
					        </translate>
 | 
				
			||||||
      </h2>
 | 
					      </h2>
 | 
				
			||||||
      <radio-button type="favorites"></radio-button>
 | 
					      <radio-button v-if="hasFavorites" type="favorites"></radio-button>
 | 
				
			||||||
    </section>
 | 
					    </section>
 | 
				
			||||||
    <section class="ui vertical stripe segment">
 | 
					    <section class="ui vertical stripe segment">
 | 
				
			||||||
      <div :class="['ui', {'loading': isLoading}, 'form']">
 | 
					      <div :class="['ui', {'loading': isLoading}, 'form']">
 | 
				
			||||||
| 
						 | 
					@ -115,7 +115,10 @@ export default {
 | 
				
			||||||
      return {
 | 
					      return {
 | 
				
			||||||
        title: this.$pgettext('Head/Favorites/Title', 'Your Favorites')
 | 
					        title: this.$pgettext('Head/Favorites/Title', 'Your Favorites')
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    },
 | 
				
			||||||
 | 
					    hasFavorites () {
 | 
				
			||||||
 | 
					      return this.$store.state.favorites.count > 0
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    updateQueryString: function() {
 | 
					    updateQueryString: function() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@
 | 
				
			||||||
          <translate translate-context="Content/Radio/Title">Instance radios</translate>
 | 
					          <translate translate-context="Content/Radio/Title">Instance radios</translate>
 | 
				
			||||||
        </h3>
 | 
					        </h3>
 | 
				
			||||||
        <div class="ui cards">
 | 
					        <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 :type="'random'"></radio-card>
 | 
				
			||||||
          <radio-card v-if="$store.state.auth.authenticated" :type="'less-listened'"></radio-card>
 | 
					          <radio-card v-if="$store.state.auth.authenticated" :type="'less-listened'"></radio-card>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
| 
						 | 
					@ -144,7 +144,13 @@ export default {
 | 
				
			||||||
        searchPlaceholder,
 | 
					        searchPlaceholder,
 | 
				
			||||||
        title
 | 
					        title
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    },
 | 
				
			||||||
 | 
					    isAuthenticated () {
 | 
				
			||||||
 | 
					      return this.$store.state.auth.authenticated
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    hasFavorites () {
 | 
				
			||||||
 | 
					      return this.$store.state.favorites.count > 0
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
    updateQueryString: _.debounce(function() {
 | 
					    updateQueryString: _.debounce(function() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue