mirror of
				https://github.com/advplyr/audiobookshelf.git
				synced 2025-10-27 11:18:14 +01:00 
			
		
		
		
	Add responsive limit for displayed items on personalized shelves on home page
This commit is contained in:
		
							parent
							
								
									43b7ccd61a
								
							
						
					
					
						commit
						618e69775c
					
				| @ -167,8 +167,19 @@ export default { | ||||
|       this.loaded = true | ||||
|     }, | ||||
|     async fetchCategories() { | ||||
|       // Sets the limit for the number of items to be displayed based on the viewport width. | ||||
|       const viewportWidth = window.innerWidth | ||||
|       let limit | ||||
|       if (viewportWidth >= 3240 && viewportWidth <= 3440) { | ||||
|         limit = 15 | ||||
|       } else if (viewportWidth >= 2880 && viewportWidth < 3240) { | ||||
|         limit = 12 | ||||
|       } | ||||
| 
 | ||||
|       const limitQuery = limit ? `&limit=${limit}` : '' | ||||
| 
 | ||||
|       const categories = await this.$axios | ||||
|         .$get(`/api/libraries/${this.currentLibraryId}/personalized?include=rssfeed,numEpisodesIncomplete,share`) | ||||
|         .$get(`/api/libraries/${this.currentLibraryId}/personalized?include=rssfeed,numEpisodesIncomplete,share${limitQuery}`) | ||||
|         .then((data) => { | ||||
|           return data | ||||
|         }) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user