diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2018-08-10 18:12:05 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2018-08-16 09:45:57 +0200 |
commit | 9a9c7aba0c763a16390c0cf8e9d0a99588f31ed3 (patch) | |
tree | 364a22f828907711fdb9cec058a6331693aa451e /server/sonar-web/src/main/js/apps/issues | |
parent | 3ee7baceba601526f60ea2a78decfc0b6c8feb8e (diff) | |
download | sonarqube-9a9c7aba0c763a16390c0cf8e9d0a99588f31ed3.tar.gz sonarqube-9a9c7aba0c763a16390c0cf8e9d0a99588f31ed3.zip |
SONAR-11149 Fix facets opening race conditions
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues')
-rw-r--r-- | server/sonar-web/src/main/js/apps/issues/components/App.tsx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.tsx b/server/sonar-web/src/main/js/apps/issues/components/App.tsx index e4486728c14..20ccf52504f 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/App.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/App.tsx @@ -451,10 +451,7 @@ export default class App extends React.PureComponent<Props, State> { Object.assign(parameters, { assignees: '__me__' }); } - return this.props.fetchIssues(parameters, requestOrganizations).then(reponse => { - this.setState({ loading: false }); - return reponse; - }); + return this.props.fetchIssues(parameters, requestOrganizations); }; fetchFirstIssues() { @@ -463,8 +460,9 @@ export default class App extends React.PureComponent<Props, State> { ({ facets, issues, paging, ...other }) => { if (this.mounted) { const openIssue = this.getOpenIssue(this.props, issues); - this.setState({ - facets: parseFacets(facets), + + this.setState(state => ({ + facets: { ...state.facets, ...parseFacets(facets) }, loading: false, issues, openIssue, @@ -476,7 +474,7 @@ export default class App extends React.PureComponent<Props, State> { selected: issues.length > 0 ? (openIssue ? openIssue.key : issues[0].key) : undefined, selectedFlowIndex: undefined, selectedLocationIndex: undefined - }); + })); } return issues; }, @@ -1040,10 +1038,10 @@ export default class App extends React.PureComponent<Props, State> { } renderPage() { - const { openIssue } = this.state; + const { loading, openIssue } = this.state; return ( <div className="layout-page-main-inner"> - <DeferredSpinner loading={this.state.loading}> + <DeferredSpinner loading={loading}> {openIssue ? ( <IssuesSourceViewer branchLike={fillBranchLike(openIssue.branch, openIssue.pullRequest)} |