diff --git a/scm-ui/src/changesets/containers/Changesets.js b/scm-ui/src/changesets/containers/Changesets.js index 48e95dd5d6..42a0efbb34 100644 --- a/scm-ui/src/changesets/containers/Changesets.js +++ b/scm-ui/src/changesets/containers/Changesets.js @@ -1,9 +1,10 @@ import React from "react" import {connect} from "react-redux"; +import {Loading} from "@scm-manager/ui-components"; import { fetchChangesetsByNamespaceAndName, fetchChangesetsByNamespaceNameAndBranch, - getChangesets, + getChangesets, isFetchChangesetsPending, } from "../modules/changesets"; import type { History } from "history"; import {fetchBranchesByNamespaceAndName, getBranchNames} from "../../repos/modules/branches"; @@ -39,10 +40,10 @@ class Changesets extends React.Component { } render() { - const {changesets, branchNames} = this.props; + const {changesets, branchNames, loading} = this.props; const branch = this.props.match.params.branch; - if (changesets === null) { - return null + if (loading || !changesets) { + return } if (branchNames) { return
@@ -65,7 +66,8 @@ class Changesets extends React.Component { const mapStateToProps = (state, ownProps: Props) => { const {namespace, name} = ownProps.repository; return { - changesets: getChangesets(namespace, name, ownProps.match.params.branch, state), + loading: isFetchChangesetsPending(namespace, name, state), + changesets: getChangesets(state, namespace, name, ownProps.match.params.branch), branchNames: getBranchNames(namespace, name, state) } };