File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ const Browse = ({ session }) => {
49
49
}
50
50
51
51
const truncateDescription = ( desc = '' , maxLength , isOpen ) => {
52
- if ( desc . length <= maxLength || isOpen ) return { truncated : desc , cutOffIndex : desc . length } ;
53
- const lastSpaceIndex = desc . substring ( 0 , maxLength ) . lastIndexOf ( ' ' ) ;
54
- const ellipsis = isOpen ? '' : '...' ;
55
- return { truncated : desc . slice ( 0 , lastSpaceIndex ) + ellipsis , cutOffIndex : lastSpaceIndex } ;
52
+ if ( desc . length <= maxLength || isOpen ) return { truncated : desc , cutOffIndex : desc . length }
53
+ const lastSpaceIndex = desc . substring ( 0 , maxLength ) . lastIndexOf ( ' ' )
54
+ const ellipsis = isOpen ? '' : '...'
55
+ return { truncated : desc . slice ( 0 , lastSpaceIndex ) + ellipsis , cutOffIndex : lastSpaceIndex }
56
56
}
57
57
58
58
return (
You can’t perform that action at this time.
0 commit comments