Update placeholder data and make placeholder dir callbacks empty
This commit is contained in:
		
							parent
							
								
									162f21089d
								
							
						
					
					
						commit
						dae708c765
					
				| @ -68,7 +68,9 @@ function Contents( | |||||||
|       }; |       }; | ||||||
| 
 | 
 | ||||||
|       if (item.is_dir) { |       if (item.is_dir) { | ||||||
|         itemProps.onClick = () => { |         itemProps.onClick = item.isPlaceholder | ||||||
|  |           ? () => {} | ||||||
|  |           : () => { | ||||||
|               const subCategory = getFileName(itemProps.url); |               const subCategory = getFileName(itemProps.url); | ||||||
| 
 | 
 | ||||||
|               if (category !== '') category = `${category}/${subCategory}`; |               if (category !== '') category = `${category}/${subCategory}`; | ||||||
| @ -137,6 +139,14 @@ function getFileName(string: string): string { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function getPlaceholderData(): galleryItemInfo[] { | function getPlaceholderData(): galleryItemInfo[] { | ||||||
|  |   const backDir = (): galleryItemInfo => { | ||||||
|  |     return { | ||||||
|  |       is_dir: true, | ||||||
|  |       url: '..', | ||||||
|  |       thumbnail_url: '', | ||||||
|  |       isPlaceholder: true, | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|   const placeholderDir = (): galleryItemInfo => { |   const placeholderDir = (): galleryItemInfo => { | ||||||
|     return { |     return { | ||||||
|       is_dir: true, |       is_dir: true, | ||||||
| @ -155,6 +165,7 @@ function getPlaceholderData(): galleryItemInfo[] { | |||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   return [ |   return [ | ||||||
|  |     backDir(), | ||||||
|     placeholderDir(), |     placeholderDir(), | ||||||
|     placeholderDir(), |     placeholderDir(), | ||||||
|     placeholderImg(), |     placeholderImg(), | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user