File tree 1 file changed +12
-9
lines changed
src/components/common/Diff
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,10 @@ const Diff = ({
272
272
toVersion,
273
273
} )
274
274
275
- const updatedHunks = React . useMemo ( ( ) => getHunksWithAppName ( hunks ) , [ hunks ] )
275
+ const updatedHunks : HunkData [ ] = React . useMemo (
276
+ ( ) => getHunksWithAppName ( hunks ) ,
277
+ [ hunks ]
278
+ )
276
279
const tokens : HunkTokens = React . useMemo (
277
280
( ) =>
278
281
tokenize ( hunks , {
@@ -323,21 +326,21 @@ const Diff = ({
323
326
selectedChanges = { selectedChanges }
324
327
>
325
328
{ ( 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 } >
329
333
< Decoration key = { 'decoration-' + hunk . content } >
330
334
< More > { hunk . content } </ More >
331
- </ Decoration > ,
335
+ </ Decoration >
332
336
< Hunk
333
337
key = { hunk . content }
334
338
hunk = { hunk }
335
339
// @ts -ignore-next-line
336
340
gutterEvents = { { onClick : onToggleChangeSelection } }
337
- /> ,
338
- ] ) }
339
- </ Fragment >
340
- ) )
341
+ />
342
+ </ Fragment >
343
+ ) )
341
344
}
342
345
</ DiffView >
343
346
) }
You can’t perform that action at this time.
0 commit comments