Fixed the way the number of content in a group is calculated
This commit is contained in:
		
							parent
							
								
									d3a349ef17
								
							
						
					
					
						commit
						262d464734
					
				| @ -93,7 +93,18 @@ export default function Contents(props: Immutable<Props>): JSX.Element { | ||||
|                   flex flex-row place-items-center gap-2" | ||||
|                 > | ||||
|                   {name} | ||||
|                   <Chip>{`${items.length} ${ | ||||
|                   <Chip>{`${items.reduce((currentSum, item) => { | ||||
|                     if (combineRelatedContent) { | ||||
|                       if (item.attributes?.group?.data?.attributes?.combine) { | ||||
|                         return ( | ||||
|                           currentSum + | ||||
|                           (item.attributes.group.data.attributes.contents?.data | ||||
|                             .length ?? 1) | ||||
|                         ); | ||||
|                       } | ||||
|                     } | ||||
|                     return currentSum + 1; | ||||
|                   }, 0)} ${ | ||||
|                     items.length <= 1 | ||||
|                       ? langui.result?.toLowerCase() ?? "" | ||||
|                       : langui.results?.toLowerCase() ?? "" | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 DrMint
						DrMint