]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-21238 Fix locations not always displayed when opening the first data flow of...
authorAmbroise C <ambroise.christea@sonarsource.com>
Tue, 16 Jan 2024 16:48:52 +0000 (17:48 +0100)
committersonartech <sonartech@sonarsource.com>
Wed, 17 Jan 2024 20:02:43 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/CrossComponentSourceViewer.tsx

index bdd33815d57e6b8a93cb0cb9f4869c649cbbb253..972d8041e8f01a73c153f955e73bae423df502db 100644 (file)
@@ -223,8 +223,7 @@ export default class CrossComponentSourceViewer extends React.PureComponent<Prop
         {locationsByComponent.map((snippetGroup, i) => {
           return (
             <SourceViewerContext.Provider
-              // eslint-disable-next-line react/no-array-index-key
-              key={`${issue.key}-${this.props.selectedFlowIndex || 0}-${i}`}
+              key={`${issue.key}-${this.props.selectedFlowIndex}-${snippetGroup.component.key}`}
               value={{ branchLike: this.props.branchLike, file: snippetGroup.component }}
             >
               <ComponentSourceSnippetGroupViewer