File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
src/components/common/Diff Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,10 @@ const Diff = ({
272272 toVersion,
273273 } )
274274
275- const updatedHunks = React . useMemo ( ( ) => getHunksWithAppName ( hunks ) , [ hunks ] )
275+ const updatedHunks : HunkData [ ] = React . useMemo (
276+ ( ) => getHunksWithAppName ( hunks ) ,
277+ [ hunks ]
278+ )
276279 const tokens : HunkTokens = React . useMemo (
277280 ( ) =>
278281 tokenize ( hunks , {
@@ -323,21 +326,21 @@ const Diff = ({
323326 selectedChanges = { selectedChanges }
324327 >
325328 { ( hunks : HunkData [ ] ) =>
326- hunks . map ( ( hunk ) => (
327- < Fragment key = { hunk . content } >
328- { updatedHunks . map ( ( hunk ) => [
329+ hunks
330+ . map ( ( _ , i ) => updatedHunks [ i ] )
331+ . map ( ( hunk ) => (
332+ < Fragment key = { hunk . content } >
329333 < Decoration key = { 'decoration-' + hunk . content } >
330334 < More > { hunk . content } </ More >
331- </ Decoration > ,
335+ </ Decoration >
332336 < Hunk
333337 key = { hunk . content }
334338 hunk = { hunk }
335339 // @ts -ignore-next-line
336340 gutterEvents = { { onClick : onToggleChangeSelection } }
337- /> ,
338- ] ) }
339- </ Fragment >
340- ) )
341+ />
342+ </ Fragment >
343+ ) )
341344 }
342345 </ DiffView >
343346 ) }
You can’t perform that action at this time.
0 commit comments